I updated this to include the icon resources for Win 98 (it's assumed that you would use the same ones on all OSes), and to include the Version Resource file.
Code:
;These are the paths to icons
;leave blank to not to alter.
;Main
MIco = E:\stuff\Pics\icons\GeoIcons\arrow.ico
;Suspend
SIco =
;Suspend
PIco =
;Suspend + Pause
SPIco =
;Version Resource - where the previously made .res file is stored
VRes = E:\stuff\version.res
;Path to ResHacker.exe
RHPath = C:\Program Files\AutoHotkey\ResHack\ResHacker.exe
;___________________________________________
; Gets path to AutoHotkey
RegRead, AHKPATH, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Run\Command,
StringGetPos, POS, AHKPATH, \AutoHotkey.exe
StringLeft, AHKPATH, AHKPATH, %POS%
IfNotExist, %AHKPath%\Compiler\AutoHotkeySC.bin
{
MsgBox, AutoHotkey is not correctly installed.
ExitApp
}
;creates backup (no overwrite so orig is retained)
FileCopy, %AHKPath%\Compiler\AutoHotkeySC.bin, %AHKPath%\Compiler\AutoHotkeySC.bak
; the first Run line is for the 2000/XP icon
; the second Run line is for 98/ME icon
IfNotEqual, MIco,
{
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %MIco%`, icon`,159`,
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %MIco%`, icon`,228`,
}
; the first Run line is for the 2000/XP icon
; the second Run line is for 98/ME icon
IfNotEqual, SIco,
{
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SIco%`, icon`,206`,
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SIco%`, icon`,229`,
}
IfNotEqual, PIco,
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %PIco%`, icon`,207`,
IfNotEqual, SPIco,
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SPIco%`, icon`,208`,
IfNotEqual, VRes,
Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %VRes%`, VersionInfo`,1`,
I discovered an interesting quirk of the ResHack program--on Win 98, at least: Opening the AutoHotkeySC.bin file from the Recent file list appears to load a cached version of at least the "Version Info" portion of the file. It took me way too long to figure that out.
