[Template] Making Sysinternals true addons for Win7

Windows 7 Update Pack discussion.
Post Reply
RP
Posts: 64
Joined: Tue Jan 01, 2008 4:00 pm

[Template] Making Sysinternals true addons for Win7

Post by RP » Sun May 13, 2012 9:49 pm

Since Sysinternals doesn't allow addon redistribution of their stuff, here are entries.ini and .INF installer templates for making your own Sysinternals addons for WINNT True Integrator. . .


1. The entries.ini. Vista and Win7 are different from XP in ignoring integrated HKCU entries, which makes accepting the EULA on Sysinternals programs a challenge. WINNT True Integrator has a workaround for that restriction with special entries.ini syntax. Here is the template, using Autoruns as an example:

Code: Select all

[general]
title = Sysinternals
description = "Microsoft Sysinternals system utilities"
version = 1.0
company = Microsoft Corporation
website = http://technet.microsoft.com/en-US/sysinternals
customizedby = RP
builddate = 05/13/2012
releasetype = True Addon

[SysPrepOC]
Sysinternals=setupapi.dll,InstallHinfSection,sysinternals.inf,Sysinternals

[GlobalOffLineChanges.Install]
AddReg = Sysinternals.Reg

[GlobalOffLineChanges.Uninstall]
DelReg = Sysinternals.Reg

[Sysinternals.Reg]
HKCU,"Software\Sysinternals"
HKCU,"Software\Sysinternals\AutoRuns"
HKCU,"Software\Sysinternals\AutoRuns","EulaAccepted",0x10001,01,00,00,00
All this does is get around the HKCU restriction to accept the EULA, then launch the install INF. Customize the [general] section as you see fit with all the usual addon descriptions. And then insert/replace the accept EULA reg entries for the programs you're including. Non-comprehensive list of program reg entries as follows:

Code: Select all

HKCU,"Software\Sysinternals\A","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\AccessChk","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\AccessEnum","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Active Directory Explorer","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ADInsight","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\AutoRuns","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\BGInfo","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\C","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\CacheSet","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ClockRes","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Coreinfo","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Ctrl2cap","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\DbgView","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Desktops","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Disk2Vhd","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\DiskExt","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Diskmon","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\DiskView","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\EFSDump","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Handle","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Hex2Dec","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Junction","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\LDMDump","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ListDLLs","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\LiveKd","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\LoadOrder","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\LoggedOn","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\LogonSessions","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\MoveFile","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\NTFSInfo","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PageDefrag","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PendMoves","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PipeList","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PortMon","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ProcDump","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Explorer","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Monitor","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ProcFeatures","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsExec","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsFile","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsGetSID","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsInfo","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsKill","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsList","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsLogList","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsPasswd","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsService","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsShutdown","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\PsSuspend","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\RegDelNull","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\RegJump","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\RootkitRevealer","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\SDelete","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Share Enum","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ShellRunas - Sysinternals: www.sysinternals.com","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\SigCheck","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Streams","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Strings","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Sync","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\TCPView","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\TCPView","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\VMMap","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\VolumeID","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\WhoIs","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\WinObj","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\ZoomIt","EulaAccepted",0x10001,01,00,00,00
As the entries.ini shows, be sure to include the parent keys for both the program and the Sysinternals branch (i.e HKCU,"Software\Sysinternals" and HKCU,"Software\Sysinternals\Autoruns" or the name of each and every program) so Integrator can safely remove it without a trace should you opt to remove the addon from an integration session.

2. The INF file. Again, showing Autoruns as an example:

Code: Select all

[Version]
Signature=$Windows NT$

;----INSTALL SECTIONS----
[Sysinternals]
CopyFiles = Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg
ProfileItems = Autoruns.Add.Shortcut

[DefaultInstall]
CopyFiles = @sysinternals.inf, Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg
ProfileItems = Autoruns.Add.Shortcut
UpdateInis = OCSysPrep.Update

;----UNINSTALL SECTIONS----
[DefaultUninstall]
BeginPrompt = Uninstaller.BeginPrompt
RunPreSetupCommands = Sysinternals.Taskkill:1
DelFiles = Sysinternals.Files
DelDirs	= Sysinternals.DelDirs
ProfileItems = Autoruns.Del.Shortcut
DelReg = Uninstaller.Reg, Sysinternals.Reg
UpdateInis = OCSysPrep.CleanUp
EndPrompt = Uninstaller.EndPrompt
CleanUp = 1

;----COMPONENT SETUP SECTIONS----
[SourceDisksNames]
1 = "Sysinternals",,,

[SourceDisksFiles]
autoruns.chm=1
autoruns.exe=1
autorunsc.exe=1
eula.txt=1

[DestinationDirs]
Sysinternals.Files = 16422,"Sysinternals"
DefaultDestDir = 17

[Sysinternals.Files]
autoruns.chm
autoruns.exe
autorunsc.exe
Eula.txt

[Sysinternals.Reg]
HKCU,"Software\Sysinternals"
HKCU,"Software\Sysinternals\AutoRuns"
HKCU,"Software\Sysinternals\AutoRuns","EulaAccepted",0x10001,01,00,00,00

[Autoruns.Add.Shortcut]
Name = "Autoruns"
InfoTip = "Shows you what programs are configured to run during system bootup or login."
CmdLine = 16422,"Sysinternals","autoruns.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[Autoruns.Del.Shortcut]
Name = "Autoruns",0x00000002
SubDir = "Sysinternals"

[Sysinternals.Taskkill]
taskkill.exe /F /IM "autoruns.exe" /T

[Sysinternals.DelDirs]
"%16422%\Sysinternals"

;----UNINSTALLER SUPPORT SECTIONS----
[Uninstaller.Reg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayName",,"Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayVersion",,"1.0"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","Publisher",,"Microsoft Corporation"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayIcon",,"%11%\imageres.dll,-36"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","UninstallString",,"rundll32.exe advpack.dll,LaunchINFSection "%17%\sysinternals.inf",DefaultUninstall"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentKeyName",,"OperatingSystem"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentDisplayName",,"Optional Components"

[OCSysPrep.Update]
%17%\OCSysPrep.inf,"Components",,"Sysinternals=advpack.dll,LaunchINFSection,sysinternals.inf,Sysinternals"

[OCSysPrep.CleanUp]
%17%\OCSysPrep.inf,Components,Sysinternals=*

[Uninstaller.BeginPrompt]
Title = "Sysinternals Uninstaller"
Prompt = "Are you sure you want to remove Sysinternals from your computer?"
ButtonType = YESNO

[Uninstaller.EndPrompt]
Prompt = "Sysinternals was successfully removed from your computer."
To modify for your Sysinternals setup, perform these steps:

a. List the program filenames under [SourceDisksFiles] and [Sysinternals.files] for the programs. Always include eula.txt in your addon.
b. Copy/paste the same exact reg entries from the entries.ini under [Sysinternals.reg]. Including the parent keys so the uninstaller works cleanly.
c. Add shortcuts under ProfileItems for every program that gets a Start Menu entry by creating matching [...Add.Shortcut] and [...Del.Shortcut] items in the format of the Autoruns one in the template for each program. Add "Program1.Add.Shortcut" (or whichever name) to the ProfileItems strings in the [Sysinternals] and [DefaultInstall] installer sections, and "Program1.Del.Shortcut", etc. to the [DefaultUninstall] ProfileItems string. Rinse, repeat for each additional program.
d. Add each .EXE file you're including in your addon under the [Sysinternals.Taskkill] section, following same format (i.e. replacing "autoruns.exe" with your program name, then copy/paste/replacing for each subsequent program). This ensures that all Sysinternals program processes are safely killed before uninstall commences.


3. Name the INF "sysinternals.inf", put all your addon's Sysinternals programs + eula.txt into a folder, put sysinternals.inf and your entries.ini file into the same folder, and pack the contents of the folder into a CAB file (any name, so long as it has the word "addon" in it). It's now ready to integrate into WINNT True Integrator on your Vista/7 install.


Customize accordingly. If you have any of the several old RVM Integrator Sysinternals addon builders you can save some labor by copy/pasting from the resulting INF's. This is largely a generic INF template, with the Uninstaller sections being reliably tailored to Vista/Win7's Programs & Features CPL, and the OCSysPrep references being the one WINNT True Integrator-specific requirement. You can also modify those RVM Sysinternals installers by swapping out the entries.ini with the above, manually adding all OCSysPrep sections and call-outs to the INF, and making sure the uninstall sections are properly tailored to Vista/7's Programs & Features CPL.
Last edited by RP on Mon May 14, 2012 8:48 am, edited 5 times in total.

RP
Posts: 64
Joined: Tue Jan 01, 2008 4:00 pm

Post by RP » Sun May 13, 2012 10:06 pm

Special variant of this template for Process Explorer only, if you want your addon to replace Task Manager with Process Explorer.

1. entries.ini is identical. Just make sure your [Sysinternals.Reg] section has the Process Explorer-specific EULA accept entry underneath HKCU,"Software\Sysinternals":

Code: Select all

HKCU,"Software\Sysinternals\Process Explorer"
HKCU,"Software\Sysinternals\Process Explorer","EulaAccepted",0x10001,01,00,00,00
2. INF file:

Code: Select all

[Version]
Signature=$Windows NT$

;----INSTALL SECTIONS----
[Sysinternals.ntamd64]
CopyFiles = Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg, ProcessExplorer.x64.Reg
ProfileItems = ProcessExplorer.Add.Shortcut

[Sysinternals.ntx86]
CopyFiles = Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg
ProfileItems = ProcessExplorer.Add.Shortcut

[DefaultInstall.ntamd64]
CopyFiles = @sysinternals.inf, Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg, ProcessExplorer.x64.Reg
ProfileItems = ProcessExplorer.Add.Shortcut
UpdateInis = OCSysPrep.Update

[DefaultInstall.ntx86]
CopyFiles = @sysinternals.inf, Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg
ProfileItems = ProcessExplorer.Add.Shortcut
UpdateInis = OCSysPrep.Update

;----UNINSTALL SECTIONS----
[DefaultUninstall.ntamd64]
BeginPrompt = Uninstaller.BeginPrompt
RunPreSetupCommands = Sysinternals.Taskkill:1
DelFiles = Sysinternals.Files
DelDirs = Sysinternals.DelDirs
ProfileItems = ProcessExplorer.Del.Shortcut
DelReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg, ProcessExplorer.x64.Reg
UpdateInis = OCSysPrep.CleanUp
EndPrompt = Uninstaller.EndPrompt
CleanUp = 1

[DefaultUninstall.ntx86]
BeginPrompt = Uninstaller.BeginPrompt
RunPreSetupCommands = Sysinternals.Taskkill:1
DelFiles = Sysinternals.Files
DelDirs = Sysinternals.DelDirs
ProfileItems = ProcessExplorer.Del.Shortcut
DelReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg
UpdateInis = OCSysPrep.CleanUp
EndPrompt = Uninstaller.EndPrompt
CleanUp = 1

;----COMPONENT SETUP SECTIONS----
[SourceDisksNames]
1 = "Sysinternals",,,

[SourceDisksFiles]
procexp.chm=1
procexp.exe=1
eula.txt=1

[DestinationDirs]
Sysinternals.Files = 16422,"Sysinternals"
DefaultDestDir = 17

[Sysinternals.Files]
procexp.chm
procexp.exe
Eula.txt

[Sysinternals.Reg]
HKCU,"Software\Sysinternals"
HKCU,"Software\Sysinternals\Process Explorer"
HKCU,"Software\Sysinternals\Process Explorer","EulaAccepted",0x10001,01,00,00,00

[ProcessExplorer.Reg]
HKLM,"SOFTWARE\Sysinternals\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe"
HKLM,"SOFTWARE\Sysinternals\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe","Debugger",,"%16422%\Sysinternals\procexp.exe"

[ProcessExplorer.x64.Reg]
HKLM,"SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe"
HKLM,"SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe","Debugger",,"%16422%\Sysinternals\procexp.exe"

[ProcessExplorer.Add.Shortcut]
Name = "Process Explorer"
InfoTip = "Shows information about which handles and DLLs processes have opened or loaded."
CmdLine = 16422,"Sysinternals","procexp.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[ProcessExplorer.Del.Shortcut]
Name = "Process Explorer",0x00000002
SubDir = "Sysinternals"

[Sysinternals.Taskkill]
taskkill.exe /F /IM "procexp.exe" /T

[Sysinternals.DelDirs]
"%16422%\Sysinternals"

;----UNINSTALLER SUPPORT SECTIONS----
[Uninstaller.Reg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayName",,"Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayVersion",,"1.0"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","Publisher",,"Microsoft Corporation"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayIcon",,"%11%\imageres.dll,-36"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","UninstallString",,"rundll32.exe advpack.dll,LaunchINFSection "%17%\sysinternals.inf",DefaultUninstall"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentKeyName",,"OperatingSystem"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentDisplayName",,"Optional Components"

[OCSysPrep.Update]
%17%\OCSysPrep.inf,"Components",,"Sysinternals=advpack.dll,LaunchINFSection,sysinternals.inf,Sysinternals"

[OCSysPrep.CleanUp]
%17%\OCSysPrep.inf,Components,Sysinternals=*

[Uninstaller.BeginPrompt]
Title = "Sysinternals Uninstaller"
Prompt = "Are you sure you want to remove Sysinternals from your computer?"
ButtonType = YESNO

[Uninstaller.EndPrompt]
Prompt = "Sysinternals was successfully removed from your computer."
The differences here are the HKLM keys for setting Process Explorer as Task Manager, and the need for separate x86 and x64 install/uninstall sections to make an INF that'll correctly set the Task Manager replacement on either an x86 or x64 system. The rest is identical to the INF template in the first post.

I don't know of any other Sysinternals utilities that have their own individual reg entries needed upon install like this or x86/x64 platform considerations, but use this as your master template if you are considering using Process Explorer as your Task Manager replacement.

RP
Posts: 64
Joined: Tue Jan 01, 2008 4:00 pm

Post by RP » Sun May 13, 2012 10:27 pm

And here's the one I'm actually using, which includes Autoruns, Process Monitor, and Process Explorer-as-Task Manager-replacement in one addon:

entries.ini

Code: Select all

[general]
title = Sysinternals
description = "Microsoft Sysinternals system utilities"
version = 1.0
company = Microsoft Corporation
website = http://technet.microsoft.com/en-US/sysinternals
customizedby = RP
builddate = 05/13/2012
releasetype = True Addon

[SysPrepOC]
Sysinternals=setupapi.dll,InstallHinfSection,sysinternals.inf,Sysinternals

[GlobalOffLineChanges.Install]
AddReg = Sysinternals.Reg

[GlobalOffLineChanges.Uninstall]
DelReg = Sysinternals.Reg

[Sysinternals.Reg]
HKCU,"Software\Sysinternals"
HKCU,"Software\Sysinternals\AutoRuns"
HKCU,"Software\Sysinternals\AutoRuns","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Explorer"
HKCU,"Software\Sysinternals\Process Explorer","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Monitor"
HKCU,"Software\Sysinternals\Process Monitor","EulaAccepted",0x10001,01,00,00,00
sysinternals.inf...

Code: Select all

[Version]
Signature=$Windows NT$

;----INSTALL SECTIONS----
[Sysinternals.ntamd64]
CopyFiles = Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg, ProcessExplorer.x64.Reg
ProfileItems = Autoruns.Add.Shortcut, ProcessExplorer.Add.Shortcut, ProcessMonitor.Add.Shortcut

[Sysinternals.ntx86]
CopyFiles = Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg
ProfileItems = Autoruns.Add.Shortcut, ProcessExplorer.Add.Shortcut, ProcessMonitor.Add.Shortcut

[DefaultInstall.ntamd64]
CopyFiles = @sysinternals.inf, Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg, ProcessExplorer.x64.Reg
ProfileItems = Autoruns.Add.Shortcut, ProcessExplorer.Add.Shortcut, ProcessMonitor.Add.Shortcut
UpdateInis = OCSysPrep.Update

[DefaultInstall.ntx86]
CopyFiles = @sysinternals.inf, Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg
ProfileItems = Autoruns.Add.Shortcut, ProcessExplorer.Add.Shortcut, ProcessMonitor.Add.Shortcut
UpdateInis = OCSysPrep.Update

;----UNINSTALL SECTIONS----
[DefaultUninstall.ntamd64]
BeginPrompt = Uninstaller.BeginPrompt
RunPreSetupCommands = Sysinternals.Taskkill:1
DelFiles = Sysinternals.Files
DelDirs = Sysinternals.DelDirs
ProfileItems = Autoruns.Del.Shortcut, ProcessExplorer.Del.Shortcut, ProcessMonitor.Del.Shortcut
DelReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg, ProcessExplorer.x64.Reg
UpdateInis = OCSysPrep.CleanUp
EndPrompt = Uninstaller.EndPrompt
CleanUp = 1

[DefaultUninstall.ntx86]
BeginPrompt = Uninstaller.BeginPrompt
RunPreSetupCommands = Sysinternals.Taskkill:1
DelFiles = Sysinternals.Files
DelDirs = Sysinternals.DelDirs
ProfileItems = Autoruns.Del.Shortcut, ProcessExplorer.Del.Shortcut, ProcessMonitor.Del.Shortcut
DelReg = Uninstaller.Reg, Sysinternals.Reg, ProcessExplorer.Reg
UpdateInis = OCSysPrep.CleanUp
EndPrompt = Uninstaller.EndPrompt
CleanUp = 1

;----COMPONENT SETUP SECTIONS----
[SourceDisksNames]
1 = "Sysinternals",,,

[SourceDisksFiles]
autoruns.chm=1
autoruns.exe=1
autorunsc.exe=1
eula.txt=1
procexp.chm=1
procexp.exe=1
procmon.chm=1
procmon.exe=1

[DestinationDirs]
Sysinternals.Files = 16422,"Sysinternals"
DefaultDestDir = 17

[Sysinternals.Files]
autoruns.chm
autoruns.exe
autorunsc.exe
Eula.txt
procexp.chm
procexp.exe
procmon.chm
Procmon.exe

[Sysinternals.Reg]
HKCU,"Software\Sysinternals"
HKCU,"Software\Sysinternals\AutoRuns"
HKCU,"Software\Sysinternals\AutoRuns","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Explorer"
HKCU,"Software\Sysinternals\Process Explorer","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Monitor"
HKCU,"Software\Sysinternals\Process Monitor","EulaAccepted",0x10001,01,00,00,00

[ProcessExplorer.Reg]
HKLM,"SOFTWARE\Sysinternals\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe"
HKLM,"SOFTWARE\Sysinternals\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe","Debugger",,"%16422%\Sysinternals\procexp.exe"

[ProcessExplorer.x64.Reg]
HKLM,"SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe"
HKLM,"SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe","Debugger",,"%16422%\Sysinternals\procexp.exe"

[Autoruns.Add.Shortcut]
Name = "Autoruns"
InfoTip = "Shows you what programs are configured to run during system bootup or login."
CmdLine = 16422,"Sysinternals","autoruns.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[ProcessExplorer.Add.Shortcut]
Name = "Process Explorer"
InfoTip = "Shows information about which handles and DLLs processes have opened or loaded."
CmdLine = 16422,"Sysinternals","procexp.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[ProcessMonitor.Add.Shortcut]
Name = "Process Monitor"
InfoTip = "Shows real-time file system, Registry and process/thread activity."
CmdLine = 16422,"Sysinternals","procmon.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[Autoruns.Del.Shortcut]
Name = "Autoruns",0x00000002
SubDir = "Sysinternals"

[ProcessExplorer.Del.Shortcut]
Name = "Process Explorer",0x00000002
SubDir = "Sysinternals"

[ProcessMonitor.Del.Shortcut]
Name = "Process Monitor",0x00000002
SubDir = "Sysinternals"

[Sysinternals.Taskkill]
taskkill.exe /F /IM "autoruns.exe" /T
taskkill.exe /F /IM "procexp.exe" /T
taskkill.exe /F /IM "procmon.exe" /T

[Sysinternals.DelDirs]
"%16422%\Sysinternals"

;----UNINSTALLER SUPPORT SECTIONS----
[Uninstaller.Reg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayName",,"Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayVersion",,"1.0"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","Publisher",,"Microsoft Corporation"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayIcon",,"%11%\imageres.dll,-36"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","UninstallString",,"rundll32.exe advpack.dll,LaunchINFSection "%17%\sysinternals.inf",DefaultUninstall"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentKeyName",,"OperatingSystem"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentDisplayName",,"Optional Components"

[OCSysPrep.Update]
%17%\OCSysPrep.inf,"Components",,"Sysinternals=advpack.dll,LaunchINFSection,sysinternals.inf,Sysinternals"

[OCSysPrep.CleanUp]
%17%\OCSysPrep.inf,Components,Sysinternals=*

[Uninstaller.BeginPrompt]
Title = "Sysinternals Uninstaller"
Prompt = "Are you sure you want to remove Sysinternals from your computer?"
ButtonType = YESNO

[Uninstaller.EndPrompt]
Prompt = "Sysinternals was successfully removed from your computer."
If you weren't doing Process Explorer as Task Manager replacement (i.e. only installing the files and creating the shortcut), the entries.ini would be identical as above and the INF would look like this:

Code: Select all

[Version]
Signature=$Windows NT$

;----INSTALL SECTIONS----
[Sysinternals]
CopyFiles = Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg
ProfileItems = Autoruns.Add.Shortcut, ProcessExplorer.Add.Shortcut, ProcessMonitor.Add.Shortcut

[DefaultInstall]
CopyFiles = @sysinternals.inf, Sysinternals.Files
AddReg = Uninstaller.Reg, Sysinternals.Reg
ProfileItems = Autoruns.Add.Shortcut, ProcessExplorer.Add.Shortcut, ProcessMonitor.Add.Shortcut
UpdateInis = OCSysPrep.Update

;----UNINSTALL SECTIONS----
[DefaultUninstall]
BeginPrompt = Uninstaller.BeginPrompt
RunPreSetupCommands = Sysinternals.Taskkill:1
DelFiles = Sysinternals.Files
DelDirs = Sysinternals.DelDirs
ProfileItems = Autoruns.Del.Shortcut, ProcessExplorer.Del.Shortcut, ProcessMonitor.Del.Shortcut
DelReg = Uninstaller.Reg, Sysinternals.Reg
UpdateInis = OCSysPrep.CleanUp
EndPrompt = Uninstaller.EndPrompt
CleanUp = 1

;----COMPONENT SETUP SECTIONS----
[SourceDisksNames]
1 = "Sysinternals",,,

[SourceDisksFiles]
autoruns.chm=1
autoruns.exe=1
autorunsc.exe=1
eula.txt=1
procexp.chm=1
procexp.exe=1
procmon.chm=1
procmon.exe=1

[DestinationDirs]
Sysinternals.Files = 16422,"Sysinternals"
DefaultDestDir = 17

[Sysinternals.Files]
autoruns.chm
autoruns.exe
autorunsc.exe
Eula.txt
procexp.chm
procexp.exe
procmon.chm
Procmon.exe

[Sysinternals.Reg]
HKCU,"Software\Sysinternals"
HKCU,"Software\Sysinternals\AutoRuns"
HKCU,"Software\Sysinternals\AutoRuns","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Explorer"
HKCU,"Software\Sysinternals\Process Explorer","EulaAccepted",0x10001,01,00,00,00
HKCU,"Software\Sysinternals\Process Monitor"
HKCU,"Software\Sysinternals\Process Monitor","EulaAccepted",0x10001,01,00,00,00

[Autoruns.Add.Shortcut]
Name = "Autoruns"
InfoTip = "Shows you what programs are configured to run during system bootup or login."
CmdLine = 16422,"Sysinternals","autoruns.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[ProcessExplorer.Add.Shortcut]
Name = "Process Explorer"
InfoTip = "Shows information about which handles and DLLs processes have opened or loaded."
CmdLine = 16422,"Sysinternals","procexp.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[ProcessMonitor.Add.Shortcut]
Name = "Process Monitor"
InfoTip = "Shows real-time file system, Registry and process/thread activity."
CmdLine = 16422,"Sysinternals","procmon.exe"
SubDir = "Sysinternals"
WorkingDir = "%HOMEDRIVE% %HOMEPATH%"

[Autoruns.Del.Shortcut]
Name = "Autoruns",0x00000002
SubDir = "Sysinternals"

[ProcessExplorer.Del.Shortcut]
Name = "Process Explorer",0x00000002
SubDir = "Sysinternals"

[ProcessMonitor.Del.Shortcut]
Name = "Process Monitor",0x00000002
SubDir = "Sysinternals"

[Sysinternals.Taskkill]
taskkill.exe /F /IM "autoruns.exe" /T
taskkill.exe /F /IM "procexp.exe" /T
taskkill.exe /F /IM "procmon.exe" /T

[Sysinternals.DelDirs]
"%16422%\Sysinternals"

;----UNINSTALLER SUPPORT SECTIONS----
[Uninstaller.Reg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayName",,"Sysinternals"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayVersion",,"1.0"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","Publisher",,"Microsoft Corporation"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","DisplayIcon",,"%11%\imageres.dll,-36"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","UninstallString",,"rundll32.exe advpack.dll,LaunchINFSection "%17%\sysinternals.inf",DefaultUninstall"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentKeyName",,"OperatingSystem"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sysinternals","ParentDisplayName",,"Optional Components"

[OCSysPrep.Update]
%17%\OCSysPrep.inf,"Components",,"Sysinternals=advpack.dll,LaunchINFSection,sysinternals.inf,Sysinternals"

[OCSysPrep.CleanUp]
%17%\OCSysPrep.inf,Components,Sysinternals=*

[Uninstaller.BeginPrompt]
Title = "Sysinternals Uninstaller"
Prompt = "Are you sure you want to remove Sysinternals from your computer?"
ButtonType = YESNO

[Uninstaller.EndPrompt]
Prompt = "Sysinternals was successfully removed from your computer."
Any combo of Sysinternals utilities you include in your addon, so long as you're not registering Process Explorer as the Task Manager replacement, can use that simpler version of the template.



Pretty simple overall to customize and add as many programs as you want. Just...
1. Add the filenames to [SourceDisksFiles], [Sysinternals.Files], and (.EXE's only) [Sysinternals.Taskkill]
2. Add the EULA accept reg entries and parent keys to [Sysinternals.Reg] in the entries.ini and the INF.
3. Add matching [...Add.Shortcut] and [...Del.Shortcut] section pairs for each program with a Start Menu entry.
4. Add each "...Add.Shortcut" item to the ProfileItems strings in each [Sysinternals] and [DefaultInstall] section, and each "...Del.Shortcut" items in the ProfileItems string in [DefaultUninstall]. Ditto if it's the template with separate "...ntx86" and "...ntamd64" platform-specific installers/uninstallers.

Post Reply