How to add/delete code in Windows 7 installation First you must convert .reg file registry lines in INF file lines: for this you need n7Epsilon Reg2Inf tool Here's is an example of windows 7 tweak reg file: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\PcaSvc] "Start"=dword:00000004 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\PcaSvc] "Start"=dword:00000004 Export it with Notepad and send it to Reg2inf and you should get this: [Version] Signature="$Windows NT$" [Optional Components] MyRegTweaks [DefaultInstall] AddReg =REGEntries.AddReg DelReg =REGEntries.DelReg [MyRegTweaks] OptionDesc ="Registry Entries" Tip ="Registry Entries" Modes =0,1,2,3 AddReg =REGEntries.AddReg DelReg =REGEntries.DelReg [REGEntries.AddReg] ; Reg2Inf v0.46 - http://tinyurl.com/fgqyf HKLM,"SYSTEM\CurrentControlSet\services\PcaSvc","Start",0x10001,04,00,00,00 HKLM,"SYSTEM\ControlSet001\services\PcaSvc","Start",0x10001,04,00,00,00 [REGEntries.DelReg] ; Reg2Inf v0.46 - http://tinyurl.com/fgqyf You can already directly use this inf file: if you name it Test.inf the entries.ini command will be: [color=limegreen];This section contains entries that need to go into the [Components] section of the OCSysPrep.inf file. [/color] [SysPrepOC] Test=advpack.dll,LaunchINFSection,Test.inf,MyRegTweaks [color=blue];for nLite RVMi in case you want to integrate the addon in Windows 2000/XP/2003 too[/color] [color=limegreen];This section contains entries that need to go into the [Components] section of the Sysoc.inf file.[/color] [sysoc] Test = ocgen.dll,OcEntry,Test.inf,HIDE,7 If you want a more professional and/or customized inf file, the only lines needed are the ones under following sections: REGEntries.AddReg and REGEntries.DelReg; got them and create an inf file compatible with both nLite/RVMi in Windows 2000/XP/2003 and DXIntegrator in Windows Vista/Seven: see more here (italian): http://www.eng2ita.net/forum/index.php/topic,7071.0.html Here is a real example on how will must be your inf file in this case: [Version] - http://msdn.microsoft.com/en-us/library/ff547502%28v=VS.85%29.aspx in a normal inf file normale you need only signature command under this section: [Version] signature="$Windows NT$" [color=green]; or signature="$Chicago$"[/color] Also these commands are default in the inf file structure, so they read and used by DXIntegrator too to take out info, etc.: DriverVer=11/14/2010, %DSCP_ProductVersion% Provider=Microsoft These command instead: Customizedby=Berserk - DMD PackageDisplayName=%ProductName% PackageReleaseType=True AddOn PackageLanguage=%LANGNAME% PackageDescription=%DSCPTip% are optionals. They are read by DXIntegrator only, in general they're not mandatory because when DXIntegrator integrates an addon it reads entries.ini file and it writes them by itself if they're are missing. [Optional Components], is the section read by SYSOC in Windows 2000/XP/2003 during Windows setup to install optional components. You can write here from one to more section name to install, in this example DSCP onlyDSCP [Optional Components] DSCP [DSCP] is the section indicated by Optional Components section, so this is the one that SYSOC will install in Windows 2000/XP/2003 Setup Following command are SYSOC defaults: this means, for example, that if Modes is missing so SYSOC don't installs this section in Windows Setup OptionDesc ="%ProductName%" Tip ="%DSCPTip%" Modes = 0,1,2,3 About AddReg: http://msdn.microsoft.com/en-us/library/ff546320%28v=VS.85%29.aspx AddReg = DSCP.Reg.Add.Values, DSCP.Add.Reg.ARP This command can be used in every kind of inf file both from SetupAPI and Advpack etc., in this case it is used to install or add our regentries in system (in the example TWEAK doesn't consider regentries deletion so DelReg is not used) [DSCP.nt] is the section read and prepared for Windows Vista/Seven Setup by DXIntegrator in this case AddReg = DSCP.Reg.Add.Values, DSCP.Add.Reg.ARP BackupReg = DSCP.Reg.Restore.Values BackupReg is a command used in advanced INF options (when LaunchINFSectionEx is used: http://www.mdgx.com/INF_web/backup.htm). Now with DXIntegrator you can run it also from SetupApi or LaunchINFSection. In DXintegrator this command has same purpose: it saves the reg before installation and then restores it during Remove or Uninstall. The only difference in this case is that DXIntegrator backs up the reg in the same inf file, very useful in our case because reg rollback can be restored both in offline mode when DxIntegrator runs and in Online mode, for example when you want to unistall an addon from the Control Panel. The rollback section name is the same but with ".RollBack" at its end, for example the reg to be saved in DSCP.Reg.Backup section will be written by DXIntegrator lin DSCP.Reg.Backup.RollBack section (In this case it's not present because DSCP.Reg.Backup.RollBack will be created by DXIntegrator when the addon is installed in Offline Mode) [DSCP.PerUser] is an optional section: Sometimes regentries are not added in a correct way or Windows setup overwrites them so better add it always after setup using peruserinstall. Peruserinstall run always before first desktop in Windows setup, after Runonce and RunonceEx, this means it is the latest configuration of system. In this example is not needed but it is here to give you an example, to enable it you only need to add ".PerUser" in entries.ini section name like this: [color=limegreen];This section contains entries that need to go into the [Components] section of the OCSysPrep.inf file. [/color] [SysPrepOC] DSCP=advpack.dll,LaunchINFSection,DSCP.inf,DSCP.PerUser [DestinationDirs] - http://msdn.microsoft.com/en-us/library/ff547383%28v=VS.85%29.aspx [DestinationDirs] DefaultDestDir = 17 in this section you need to indicate directory destinations where to copy/delete/rename/etc. files. In the example is added to use "DefaultDestDir" command, and it shows where to copy inf file inf [DSCP.Reg.Add.Values] is the section shown in AddReg command under "DSCP" and "DSCP.nt" sections (as always this regline works with both Windows XP and Windows 7) [DSCP.Reg.Add.Values] [color=limegreen]; Disables Program Compatibility Service[/color] HKLM,"SYSTEM\CurrentControlSet\services\PcaSvc","Start",0x10001,04,00,00,00 HKLM,"SYSTEM\ControlSet001\services\PcaSvc","Start",0x10001,04,00,00,00 [DSCP.Add.Reg.ARP] is the section shown in AddReg command under "DSCP" and "DSCP.nt" sections: these regentries adds removal option in Control Panel [DSCP.Add.Reg.ARP] HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","DisplayIcon", ,"%10%\regedit.exe" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","DisplayName", ,"%ProductName% %DSCP_ProductVersion%" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","DisplayVersion", ,"%DSCP_ProductVersion%" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","OnlineVersion", ,"%DSCP_ProductVersion%" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","Publisher", ,"DMD" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","UninstallString", ,"rundll32.exe advpack.dll,LaunchINFSection %17%\DSCP.inf,DefaultUninstall" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","URLInfoAbout", ,"http://www.eng2ita.net/forum/index.php/topic,6164.0.html" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","ParentKeyName", ,"OperatingSystem" HKLM,"%KEY_WIN_CURVER%\Uninstall\DSCP","ParentDisplayName", ,"%PARENT_DISPLAY_NAME%" [PerUserInst] is the section shown in PerUserInstall command under "DSCP.PerUser" section [PerUserInst] DisplayName=%ProductName% Version=1.0.0000.0 IsInstalled=1 ComponentID=DSCP GUID={x0020200-ecbd-11cf-8b85-00aa0050dscp} Locale=en StubPath=rundll32.exe advpack.dll,LaunchINFSection %17%\DSCP.inf,PerUser.Install,1,N StubPath command shows the command to run: in the example it runs the command which installs "PerUser.Install" section [PerUser.Install] is the section to be installed in PerUser Mode in StubPath command under "PerUserInst" section [PerUser.Install] AddReg = DSCP.Reg.Add.Values, DSCP.Add.Reg.ARP DelReg = PerUser.CleanUp [PerUser.CleanUp] is the section indicated in DelReg command under "PerUser.Install" section [PerUser.CleanUp] HKCU,"Software\Microsoft\Active Setup\Installed Components\>{x0020200-ecbd-11cf-8b85-00aa0050dscp}" HKLM,"Software\Microsoft\Active Setup\Installed Components\>{x0020200-ecbd-11cf-8b85-00aa0050dscp}" HKU,".DEFAULT\Software\Microsoft\Active Setup\Installed Components\>{x0020200-ecbd-11cf-8b85-00aa0050dscp}" HKU,"S-1-5-18\Software\Microsoft\Active Setup\Installed Components\>{x0020200-ecbd-11cf-8b85-00aa0050dscp}" HKU,"S-1-5-19\Software\Microsoft\Active Setup\Installed Components\>{x0020200-ecbd-11cf-8b85-00aa0050dscp}" HKU,"S-1-5-20\Software\Microsoft\Active Setup\Installed Components\>{x0020200-ecbd-11cf-8b85-00aa0050dscp}" this will remove all regentries used in peruser mode: better do this as peruser mode has been used only to execute a single command and nothing else but generally you can also not remove these lines, so everytime you add a new user account, with new configurations "rundll32.exe advpack.dll,LaunchINFSection %17%\DSCP.inf,PerUser.Install" will start again. Warning: this is valid with DXIntegrator in Windows Vista/Seven only: in Windows 2000/XP/2003 nLite/RVMi won't work because SYSOC doesn't recognize PerUserInstall command. In Windows 2000/XP/2003 you must use a different way (see inside Onepiece's IE7/8 addon) [DefaultUninstall] is the section indicated in "DSCP.Add.Reg.ARP" section, in other word the section executed when Control Panel uninstall is chosen [DefaultUninstall] BeginPrompt = BeginUnInsPrompt AddReg = DSCP.Reg.Backup.RollBack DelReg = DSCP.Add.Reg.ARP UpdateInis = DSCP.OCSysPrep.CleanUp EndPrompt = EndUnInsPrompt CleanUp = 1 [DSCP.OCSysPrep.CleanUp] is the section indicated in UpdateInis command under "DefaultUninstall" section [DSCP.OCSysPrep.CleanUp] %17%\OCSysPrep.inf,Components,DSCP=* This section removes the component from [Components] section in %WinDir%\inf\OCSysPrep.inf (as SYSOC does in Windows 2000/XP/2003) [beginUnInsPrompt] is the section indicated in BeginPrompt command under "DefaultUninstall" section [BeginUnInsPrompt] Title = %ProductName% Uninstaller Prompt = %UnInsPrompt% ButtonType = YESNO ;<- YESNO or OKCANC This opens a windows before removal starts, prompting if you want to proceed or not: if you click on YES removal starts, if you click on NO removal is aborted. [EndUnInsPrompt] is the section indicated in EndPrompt command under "DefaultUninstall" section [EndUnInsPrompt] Prompt = %EndUnInsPrompt% This opens a windows at the end of removal process, informing if removal has been successful or not, etc. [DefaultInstall] is the section which starts when installation is manually run clicking on inf file. [DefaultInstall] BeginPrompt = BeginInstPrompt CopyFiles = @DSCP.inf AddReg = DSCP.Reg.Add.Values, DSCP.Add.Reg.ARP UpdateInis = Update.Sysoc EndPrompt = EndInstPrompt About command CopyFiles http://msdn.microsoft.com/en-us/library/ff546346%28v=VS.85%29.aspx Warning! According to inf file rules, if no section name has been indicated in installation command, DXIntegrator always search for DefaultInstall section, and if found customizes and installs it, for example if in entries.ini you use these lines [SysPrepOC] DSCP=advpack.dll,LaunchINFSection,DSCP.inf then DXIntegrator search inside DSCP.inf file DefaultInstall section and customizes and installs it [update.Sysoc] is the section indicated in UpdateInis command under "DefaultInstall" section [Update.Sysoc] %17%\OCSysPrep.inf,"Components",,"DSCP=advpack.dll,LaunchINFSection,DSCP.inf,DSCP" This section adds the component in [Components] section in %WinDir%\inf\OCSysPrep.inf (as SYSOC does in Windows 2000/XP/2003) [beginInstPrompt] is the section indicated in BeginPrompt command under "DefaultInstall" section [BeginInstPrompt] Title = %ProductName% Uninstaller Prompt = %InstPrompt% ButtonType = YESNO ;<- YESNO or OKCANC This opens a windows before installation starts, prompting if you want to proceed or not: if you click on YES installation starts, if you click on NO installation is aborted. [EndInstPrompt] is the section indicated in EndPrompt command under "DefaultInstall" section [EndInstPrompt] Prompt = %EndInstPrompt% This opens a windows at the end of installation process, informing if installation has been successful or not, etc. [strings] - http://msdn.microsoft.com/en-us/library/ff547485%28v=VS.85%29.aspx is the section where you can place the variables used in your inf file These are the main options but inf file have endless possibilities. For further information follow Microsoft Guides INF Sections - http://msdn.microsoft.com/en-us/library/ff547465%28v=VS.85%29.aspx INF commands - http://msdn.microsoft.com/en-us/library/ff547388%28v=VS.85%29.aspx Adding an entries.ini file created as usual, now you can create with your inf file a .cab Addon using CabTool http://www.eng2ita.net/forum/index.php/topic,6628.0.htm Here is a windows 7 registry tweaks collection http://www.eng2ita.net/forum/index.php/topic,6164.0.html (italian) and here are some sample addons (italian): DMD Windows 7 Raccolta Tweak di registro True AddOn Update (March 23-2011) Hash MD5 F103C39522A8D64A29E8F5603AFE5210 Filesize: 6.77 KB (6942 bytes) DMD Abilita visualizzazione .mkv in MediaCenter True AddOn Update (March 23-2011) Hash MD5 ECF5893C528E3093857CCDF393F26554 Filesize: 4.00 KB (4102 bytes) DMD Aggiungere comandi COPIA e SPOSTA True AddOn Update (March 23-2011) Hash MD5 859956469C3C264698AD2E2FDC668EBD Filesize: 3.07 KB (3144 bytes) DMD Apertura Menu rapidi True AddOn Update (March 23-2011) Hash MD5 5F60D1A500C7D87709EC2CF14D2BB477 Filesize: 2.89 KB (2964 bytes) DMD Apparizione cestino in esplora risorse True AddOn Update (March 23-2011) Hash MD5 FD20BEBC067AB9A15BB999BCA9A6EA3F Filesize: 2.98 KB (3058 bytes) DMD Disattiva il servizio compatibilità programmi True AddOn Update (March 23-2011) Hash MD5 38AC0AD68FE1A029FF8B4C79750F56C6 Filesize: 2.93 KB (3002 bytes) DMD Impostazioni dei Valori UAC True AddOn Update (March 23-2011) Hash MD5 740D25D741A25A0B7AA1FEF2405BA169 Filesize: 3.25 KB (3330 bytes)