Skip to content

Instantly share code, notes, and snippets.

View daemondevin's full-sized avatar

daemon.devin daemondevin

View GitHub Profile
;=#
;
; NSIS Associations Handler
; Provides functions for managing file types, protocols, and context menus
; by daemon.devin (daemon.devin@gmail.com)
;
; AVAILABLE FILETYPE MACROS
; ${GetFileTypeProgID}
; ${CheckFileTypeExists}
; ${GetFileTypeInfo}
@daemondevin
daemondevin / ActiveXObject.polyfill.js
Created November 23, 2025 02:30
ActiveXObject Polyfill
/**
* ActiveXObject Polyfill
* Provides fallback implementations for common ActiveX objects
* Note: This only works for specific objects and has limited functionality
*/
(function() {
'use strict';
// Skip if ActiveXObject already exists (IE)
@daemondevin
daemondevin / RuntimeManager.nsh
Last active November 8, 2025 05:35
NSIS Include that manages VC++ (2005-2022) and .NET (Framework/Core) redistributables. Supports x86, x64, and ARM64 architectures.
; RuntimeManager.nsh - Complete Runtime Detection, Download, and Installation
; Manages VC++ (2005-2022) and .NET (Framework/Core) redistributables
; Supports x86, x64, and ARM64 architectures
!ifndef RUNTIME_MANAGER_NSH
!define RUNTIME_MANAGER_NSH
!ifndef LOGICLIB
!include LogicLib.nsh
!endif
@daemondevin
daemondevin / ModernWinVer.nsh
Created November 3, 2025 08:11
Modern Windows Version Detection Optimized for Windows 10, 11, and current Server versions
; ModernWinVer.nsh - Modern Windows Version Detection
; Optimized for Windows 10, 11, and current Server versions
; Extends and modernizes the standard WinVer.nsh
!ifndef MODERN_WINVER_NSH
!define MODERN_WINVER_NSH
!include LogicLib.nsh
; Windows Version Constants (Major.Minor.Build)
@daemondevin
daemondevin / WindowsFeature.nsh
Last active November 2, 2025 02:33
NSIS macros for checking and enabling Windows Features
; Check if Windows Feature needs to be enabled (e.g., .NET 3.5 on Windows 10+)
!define CheckWindowsFeature `!insertmacro _CheckWindowsFeature`
!macro _CheckWindowsFeature _FEATURE _RESULT
Push $0
Push $1
Push $R8
StrCpy ${_RESULT} "unknown"
; Use DISM to check Windows feature status
@daemondevin
daemondevin / codesign.rs
Last active October 18, 2025 09:18
Code signing utility written in Rust. This utility has support for generating a new RSA key pair, generating a self-signed certificate for code signing, signing a file with a certificate, and verifying a file signature.
// Code Signing Utility with Certificate Support
// Signs programs and verifies signatures using RSA cryptography with X.509 certificates
//
use base64::{engine::general_purpose, Engine as _};
use chrono::{Duration, Utc};
use clap::{Parser, Subcommand};
use der::{Decode, Encode};
use rsa::{
pkcs8::{DecodePrivateKey, DecodePublicKey, EncodePrivateKey, EncodePublicKey, LineEnding},
@daemondevin
daemondevin / lnk.rs
Last active October 18, 2025 07:30
Windows link creation utility written in Rust.
use std::{
ffi::OsStr,
os::windows::ffi::OsStrExt,
path::PathBuf,
ptr,
};
use owo_colors::OwoColorize;
use structopt::StructOpt;
@daemondevin
daemondevin / CheckLink.nsh
Last active September 18, 2025 16:43
Determines if a path is a symbolic link, junction, hard link, or regular file/directory
@daemondevin
daemondevin / CreateSymlink.nsh
Created September 6, 2025 23:20
This function creates Windows symbolic links with flexible options for different link types and path configurations.
@daemondevin
daemondevin / CreateJunction.nsh
Last active September 6, 2025 23:08
This function creates Windows directory junctions (symlinks for directories) using low-level Windows API calls.
/**
* CreateJunction.nsh v1.0
*
* Creates Windows directory junctions (symlinks for directories)
* using low-level Windows API calls.
*
* Macro Usage:
* ${CreateJunction} "$JunctionPath" "$TargetPath" $0 $1
* $0 holds true/false
* $1 holds error message if failed, empty if success