Jump to content

copying multiple versions with same file name to multiple target folders

Recommended Posts

I would like to add nircmd via true addon CAB (a great little utility by Nir Sofer) to my Win7 x64 offline image (ie for making ISO out of it later).


It has both x86 and x64 versions.


SInce i intend to use it on x64 Windows, it means that calling application (usually cmd.exe) will call the corresponding version of nircmd (x86 cmd calls x86 nircmd and respectively x64 cmd.exe calls x64 version of nircmd).


Now a problem : i can make a CAB file that holds both versions under different names in same folder inside CAB, but since in future i intend to add other dual-bitness applications, this will be a problem for me.


I have my CAB referenced in Entries.ini like so

[txtsetup_files]AddUtils.cab = 1,,,,,,_x,,3,3

Note that i have left out other relevant information to make this post short and to the point.


I would like to package both versions of nircmd in CAB file under different subdirectories, like so :

MYCABFILE.CAB   < CAB file itself\X86VER\nircmd.exe  < first version in subdirectory\X64VER\nircmd.exe < second version in other subdirectory

I was reading INF reference documentation on MS site and it mentions multiple directories, but it is unclear to me if the above is possible.   There are two descriptions that don't explain this well enough :

[SourceDisksNames]diskid = disk-description[,[tag-or-cab-file],[unused],[path],[flags][,tag-file]]

I don't know if "path" part refers to my above case of subdirectories in CAB file or some other location.


Second one is

[SourceDisksFiles]filename=diskid[,[ subdir][,size]]

Also, i'm not sure to what "subdir" points to.



I was trying to find other true addons as examples (so far, they have been useful), and closest one is for Notepad2, similar to what i need, but it either copies x86 or x64 version (as defined in section names), and i need BOTH versions of nircmd.exe to be copied in their respective directories (%SystemRoot%\System32 and %SystemRoot%\SysWOW64).


I hope i haven't overcomplicated my post, i just wanted to be as specific as possible.

Link to post
Share on other sites

I posted in this sub-forum to ask for help on integrating files directly in windows image, no post-install workarounds. All files in my CAB need to be present in their target locations as early as possible, at least during setup phase (i'm also using unattended setup).


I was using XP/nLite before this so i have expirience with making addons and i'm biased toward using this method.


I could experiment with before mentioned path definitions in .INF files and test by doing DXTi integration, and leaving image mounted, then have a look inside mount directory, but i would really like to avoid as it can take time (each add,remove and re-commit).

Edited by BusyElf
Link to post
Share on other sites

Hi BusyElf, the inf setup and all other microsoft setup (like Windows Installer) do not support subdirectory inside cab archive, but it supports anything else so you do not need to do so that is not the most efficient and useful mod, so for this reason Microsoft does not use it, the alternatives are many (I do not know if nLite\RVMi support them I think not, but the DX WinNT6.x True Integrator supports all), so in INF SourceDisksNames Section



This optional value specifies the directory path on the distribution disk that contains source files. The path is relative to the installation root and is expressed as \dirname1\dirname2... and so forth. If this value is omitted from an entry, files are assumed to be in the installation root of the distribution disk.

You can use an INF SourceDisksFiles section to specify subdirectories, relative to a given path directory, that contain source files. However, tag files and cabinet file must reside either in the given path directory or in the installation root.

and in INF SourceDisksFiles Section


The following example shows a SourceDisksNames section and a corresponding SourceDisksFiles section.


[SourceDisksNames];; diskid = description[, [tagfile] [, <unused>, subdir]];1 = %Floppy_Description%,,,\WinNT[SourceDisksFiles.x86]aha154x.sys = 1,\x86 ; on distribution disk 1, in subdir \WinNT\x86; ...

so Mod 1 (nLite\RVMi support it)


Mod 2


Mod 3


in poor words with Inf Setup you can do every everything, and even perfectly and safe, in the end is a Microsoft thing ehhhh

anyway see also how WinRAR True AddOn install the theme from Entries.ini, that an easy way, but not as useful as INF SourceDisksFiles because INF SourceDisksFiles check recent\version file ect ect

ahhh in x64 Setup for x32 files use DirId 16425 (16425 = %SystemRoot%\system32 ;OR %SystemRoot%\SysWOW64 in X64), as i said before inside all True AddOns find all possible examples


Link to post
Share on other sites

Sooo. i've look at the examples, and the moment i looked at third one for CCleaner i will quote great minds of our time : "A-HA!"


OnePiece, you rule !


[EDIT: i replied the moment i saw your post and missed the "Mod 3" note, art can't be rushed :)]

Edited by BusyElf
Link to post
Share on other sites

Umm OnePiece i need more help !


I have defined multiple diskid's in [sourceDisksNames] with above mentioned subdirectories, so same file names do not collide and have referenced them in [sourceDisksFiles] with filename=diskid pairs.


Now i have one final problem :


I have CopyFiles directive in my custom install section [utilities] and i do not know how to reference a specific version among files with same name but different subdirectory in CAB install root.


Config for clarification (with problem at end)

;custom named section, this could be DefaultInstall as well[Utilities]CopyFiles = files_x86, files_x64;directory targets for CopyFiles[DestinationDirs]files_x86 = 16425files_x64 = 16421;subdirectories inside files CAB addon[SourceDisksNames]1="MyFiles","MYFILES.cab",,"X86VER\nircmdc.exe"2="MyFiles","MYFILES.cab",,"X64VER\nircmdc.exe";references to files and their sources in CAB[SourceDisksFiles]NIRCMDC.EXE=1NIRCMDC.EXE=2;OOOPS ! Now what to do ? CopyFiles section referenced above has defined everything but here i hit a wall.;How does windows optional components installer know WHICH file i reference ???;At best, it will mix up 86 and x64 versions, at worst it will completely mess up OS setup[files_x86]nircmdc.exe,NIRCMDC.EXE[files_x64]nircmdc.exe,NIRCMDC.EXE 

Ok i hope i explained this well. I know that .x86 and .amd64 suffixes in section names can remove this ambiguity but i would need both x86 and x64 versions of files to be copied.




But this will copy only one of them, depending on OS architecture used in setup. I need both.

Link to post
Share on other sites

[Version]    signature="$Windows NT$"[NirSoft.ntx86]    CopyFiles     = NirSoft.x86.System.Files    AddReg        = Uninstall.AddReg[NirSoft.ntamd64]    CopyFiles      = NirSoft.x86.System.Files, NirSoft.amd64.System.Files    AddReg         = Uninstall.AddReg[NirSoft.x86.System.Files]    NirCmd.chm, , ,32    nircmd.exe, , ,32    nircmdc.exe, , ,32[NirSoft.amd64.System.Files]    NirCmd.chm, , ,32    nircmd.exe, , ,32    nircmdc.exe, , ,32[DestinationDirs]    NirSoft.x86.System.Files   = 16425    NirSoft.amd64.System.Files = 11    DefaultDestDir             = 17[SourceDisksNames.x86]    1="NirSoft Files","WINNT6",,"\x86"[SourceDisksNames.amd64]    2="NirSoft x64 Files","WINNT6",,"\amd64"[SourceDisksFiles.x86]    NirCmd.chm=1,,45977    nircmd.exe=1,,44032    nircmdc.exe=1,,43520[SourceDisksFiles.amd64]    NirCmd.chm=2,,45977    nircmd.exe=2,,115712    nircmdc.exe=2,,113664[Uninstall.AddReg]    ;   Used during remove    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft"    ;   Used during install    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","DisplayIcon", ,"%11%\NirSoft.exe"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","DisplayName", ,"NirSoft %NirSoft_ProductVersion%"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","DisplayVersion", ,"%NirSoft_ProductVersion%"    ;HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","Language", ,"%LanguageId%"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","OnlineVersion", ,"%NirSoft_ProductVersion%"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","Publisher", ,"Nir Sofer."    ;HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","UninstallString", ,"%11%\uninst.exe"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","UninstallString", ,"rundll32.exe advpack.dll,LaunchINFSection %17%\NirSoft.inf,DefaultUninstall"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","URLInfoAbout", ,"http://www.nirsoft.net/"    ;HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","SystemComponent",%REG_DWORD%,"1"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","ParentKeyName", ,"OperatingSystem"    HKLM,"%KEY_WIN_CURVER%\Uninstall\NirSoft","ParentDisplayName", ,"%PARENT_DISPLAY_NAME%"[DefaultUninstall]    BeginPrompt         = BeginUnInsPrompt    RunPreSetupCommands = Stop_NirSoft:1    DelFiles            = NirSoft.x86.System.Files, NirSoft.amd64.System.Files    DelReg              = Uninstall.AddReg    EndPrompt           = EndUnInsPrompt[Stop_NirSoft]    TASKKILL /F /IM nircmd.exe    TASKKILL /F /IM nircmdc.exe[BeginUnInsPrompt]    Title      = %PROG_NAME% Uninstaller    Prompt     = %UnInsPrompt%    ButtonType = YESNO ;<- YESNO or OKCANC[EndUnInsPrompt]    Prompt        = %EndUnInsPrompt%[DefaultInstall.ntx86]    CopyFiles    = @NirSoft.inf, NirSoft.x86.System.Files    AddReg      = Uninstall.AddReg[DefaultInstall.ntamd64]    CopyFiles    = @NirSoft.inf, NirSoft.x86.System.Files, NirSoft.amd64.System.Files    AddReg      = Uninstall.AddReg[Strings]    KEY_WIN_CURVER             = "Software\Microsoft\Windows\CurrentVersion"    NirSoft_ProductVersion     = "1.0.0"    PROG_NAME                  = "NirSoft"    REG_EXPAND_SZ=0x00020000    REG_SZ=0x00000000    REG_DWORD=0x00010001    REG_BINARY=0x00000001    REG_MULTI_SZ = 0x00010000    REG_DWORD_NOCLOBBER = 0x00010003    Reg_SZ_NOCLOBBER = 0x00000002    REG_BINARY_NOCLOBBER = 0x00000003    REG_MULTI_SZ_APPEND = 0x0001000A    REG_MULTI_SZ_NOCLOBBER = 0x00010002    REG_MULTI_SZ_DELVAL = 0x00010006    REG_ADDREG_APPEND = 0x00010008    REG_EXPAND_SZ_NOCLOBBER = 0x00020002    REG_NONE = 0x00020001    VALUE_NOT_SET = 0x00000010    VALUE_NOT_SET_NOCLOBBER = 0x00000012    ;Localizable    LANGNAME            = "English"    LanguageId          = "1033"    NirSoftTip          = "Freeware Utilities for Windows "    PARENT_DISPLAY_NAME = "Optional Components"            ;"Windows XP - Software Updates"    UnInsPrompt         = "Are you sure you want to remove NirSoft from your computer?"    EndUnInsPrompt      = "NirSoft was successfully removed from your computer."

See example (Remember NirSoft_True_AddOn.cab (Also like structure) is more Ok)

NirSoft_True_AddOn_WinNT6.x_Only.cab (for WinNT6.x Vista/Seven/8/10/NEXT with WinNT6.x True Integrator)

NirSoft_True_AddOn.cab (for WInNT5.x XP\2003 with nLite\RVMI and WinNT6.x Vista/Seven/8/10/NEXT with WinNT6.x True Integrator)





Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By ricktendo
      Here is something you guys might find useful, Its a must have if you are into driverpack making and it comes with InstallShield (used to extract drivers/files from installers with data1.cab/hdr packages created with InstallShield)
      Here is my SendTo style installer, I extracted the files from InstallShield 2018 SP1 (may also require Visual C++ Runtimes)
      Download: https://mega.nz/#F!SpQgkAII!07wjhxEh89CUQlTV8oXPyg
      MD5: 7de20da0f41b1425739f23ad49b31a59
      Size: 18.2 MB
      For unattended install
      Passive:<installer>.exe /SILENTQuiet:<installer>.exe /VERYSILENTOther command-line options:/NOICONSInstructs Setup to initially check the Don't create a Start Menu folder check box on the Select Start Menu Folder wizard page./COMPONENTS="!help"Do NOT! install "Help files" components. (If a component name is prefixed with a "!" character, the component will be deselected.)/TASKS="sendtoicon,desktopicon,quicklaunchicon"Deselect all tasks, then select the "desktopicon", "sendtoicon" and "quicklaunchicon" (Vista & under) tasks. (Use the /MERGETASKS parameter instead if you want to keep the default set of tasks and only select/deselect some of them.)/MERGETASKS="desktopicon"Keep the default set of selected tasks, but additionally select the "desktopicon" tasks. (If a task name is prefixed with a "!" character, the task will be deselected.)
    • By Alphaziel
      WinToolkit Version:
      DISM Version: 6.3.9600.17029
      Target Install OS: Windows 7 Ultimate SP1 x64
      Target PC
      M/B: ASUSTeK 970 PRO GAMING/AURA CPU: AMD Phenom II X6 1100T RAM: Kingston DDR3-1333 2GB*2 SSD: Intel SSD 600p Series (512GB, M.2 80mm PCIe 3.0 x4, 3D1, TLC) Look at this page Update to add native driver support in NVM Express in Windows 7 and Windows Server 2008 R2, we used the WinToolkit in boot.wim and incorporating the NVM Express driver to install.wim * .wim file
      Preset of WinToolkit are as follows:
      #Silent Installs
      mpas-feX64::;NO;15.58 MB;mpas-feX64.exe;Always Installed
      AspNetMVC4::/passive /norestart;NO;1.16 MB;AspNetMVC4.msi;Always Installed
      Windows-KB890830-x64-v5.41::/q /n /z;NO;47.79 MB;Windows-KB890830-x64-v5.41.exe;Always Installed
      DXSETUP Jun2010::/silent;YES;98.39 MB;DirectX\DXSETUP.exe;Always Installed
      vcredist_x86_2005_6.0.3790.0::/q;NO;2.59 MB;VC\x86\vcredist_x86_2005_6.0.3790.0.exe;Always Installed
      vcredist_x64_2005_6.0.3790.0::/q;NO;3.05 MB;VC\x64\vcredist_x64_2005_6.0.3790.0.exe;Always Installed
      vcredist_x86_2008_9.0.30729.5677::/q;NO;4.27 MB;VC\x86\vcredist_x86_2008_9.0.30729.5677.exe;Always Installed
      vcredist_x64_2008_9.0.30729.5677::/q;NO;4.97 MB;VC\x64\vcredist_x64_2008_9.0.30729.5677.exe;Always Installed
      vcredist_x86_2010_10.0.40219.325::/q;NO;8.57 MB;VC\x86\vcredist_x86_2010_10.0.40219.325.exe;Always Installed
      vcredist_x64_2010_10.0.40219.325::/q;NO;9.80 MB;VC\x64\vcredist_x64_2010_10.0.40219.325.exe;Always Installed
      vcredist_x86_2012_11.0.61030.0::/install /passive;NO;6.25 MB;VC\x86\vcredist_x86_2012_11.0.61030.0.exe;Always Installed
      vcredist_x64_2012_11.0.61030.0::/install /passive;NO;6.86 MB;VC\x64\vcredist_x64_2012_11.0.61030.0.exe;Always Installed
      vcredist_x86_2013_12.0.30501.0::/install /passive;NO;6.20 MB;VC\x86\vcredist_x86_2013_12.0.30501.0.exe;Always Installed
      vcredist_x64_2013_12.0.30501.0::/install /passive;NO;6.86 MB;VC\x64\vcredist_x64_2013_12.0.30501.0.exe;Always Installed
      vc_redist.x86_2015_14.0.23026.0::/install /passive;NO;13.13 MB;VC\x86\vc_redist.x86_2015_14.0.23026.0.exe;Always Installed
      vc_redist.x64_2015_14.0.23026.0::/install /passive;NO;13.90 MB;VC\x64\vc_redist.x64_2015_14.0.23026.0.exe;Always Installed
      Journal_en-us_x64::/passive /norestart;NO;4.44 MB;Journal_en-us_x64.msi;Always Installed
      Silverlight_x86_2016-10-05::/Q;NO;6.70 MB;Silverlight_x86_2016-10-05.exe;Always Installed
      Silverlight_x64_2016-10-05::/Q;NO;12.56 MB;Silverlight_x64_2016-10-05.exe;Always Installed
      dotNetFx461_Full_x86_x64intl_Slim::/y;NO;80.20 MB;dotNetFx461_Full_x86_x64intl_Slim.exe;Always Installed
      NDP46-KB3142037-x64::/passive /norestart;NO;2.57 MB;NDP46-KB3142037-x64.exe;Always Installed
      NDP46-KB3143693-x64::/passive /norestart;NO;15.24 MB;NDP46-KB3143693-x64.exe;Always Installed
      NDP46-KB3164025-x64::/passive /norestart;NO;3.30 MB;NDP46-KB3164025-x64.exe;Always Installed
      NDP45-KB3179930-x64::/passive /norestart;NO;42.52 MB;NDP45-KB3179930-x64.exe;Always Installed
      NDP46-KB3179949-x64::/passive /norestart;NO;60.88 MB;NDP46-KB3179949-x64.exe;Always Installed
      install_flash_player_23.0.0.162::-install;NO;19.21 MB;install_flash_player_23.0.0.162.exe;Always Installed
      install_flash_player_ax_23.0.0.162::-install;NO;18.70 MB;install_flash_player_ax_23.0.0.162.exe;Always Installed
      Without GWX(Microsoft spyware), IE9, IE10, IE11
      Install at USB memory with the above settings Disable the extra task scheduler powercfg.exe /hibernate off
      schtasks /CHANGE /DISABLE /TN "\Microsoft\Windows\Defrag\ScheduledDefrag"
      schtasks /CHANGE /DISABLE /TN "\Microsoft\Windows\Maintenance\WinSAT"
      schtasks /CHANGE /DISABLE /TN "\Microsoft\Windows Defender\MP Scheduled Scan"
      schtasks /CHANGE /DISABLE /TN "\Microsoft\Windows Defender\MpIdleTask"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Application Experience\AitAgent"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Autochk\Proxy"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Windows Error Reporting\QueueReporting"
      schtasks /Change /Disable /TN "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem"
      Install Display driver
      Install Realtek Sound Driver
      Rollup (KB3125574) Install the following update package manually. Never using the WUSA command at the command processor, etc., do not install in the /norestart options, etc.. Run the .msu file from obediently Explorer
      1. KB2534366
      2. KB2533552
      3. KB3020369
      4. KB3125574 (2 times reboot PC)
      5. KB3145739 (It has been replaced by KB3185330)
      6. KB3161664 (It has been replaced by KB3185330)
      7. KB3161608 (need reboot PC. When the previously Kernel / User-Mode Driver Framework 1.11 (KB2685811 KB2685813) is installed, the system configuration time for individual shutdown will take longer than)
      8. KB3172605
      9. KB3185911 (need reboot PC)
      Kernel/User-Mode Driver Framework 1.11 (KB2685811 KB2685813) 1. KB2685811
      2. KB2685813
      3. KB3153199 (It has been replaced by KB3185330)
      4. KB3156017 (need reboot PC)
      This is where you perform confirmation of the Windows Update update the first time in the control panel
      My confirmation in about 3 minutes on a PC has been terminated GWX and IE11
      Below, all remove check, to hide, click OK, and re-check for updates
      1. KB2952664
      2. KB3021917
      3. KB3068708
      4. KB3080149
      5. IE11
      Below, all remove check, to hide, click OK, and re-check for updates
      IE9, IE10
      Manually install in the same way the following update package

      KB3136000 (.NET Framework 4.6.1)
      We spent a theme patch
      DWS to check in (Destroy Windows Spying) tool, the FINISH INSTALL!!
      It was finished, we continue why KB3136000 is Isuwari. Somehow, the last few months much it's damn thing is there ...

      The results of WinSAT is this. RAM lol poor !!

      Intel SSD 600p Series is (512GB, M.2 80mm PCIe 3.0 x4, 3D1, TLC) benchmark results

      It is a benchmark result of Video Card nVIDIA GTX960

      I was able to finish the task in about two hours
    • By hkroiss
      Hi, since around 1.5 half years i am integrating Updates into our Windows Image at our Company. However i have noticed that even when all the latest Updates are integrated after installing the OS it shows a few ".NET Framework" Updates that couldn't be integrated (see Attachment). A year ago it were only around 10, now around 15. So its getting more and more, it hinders the usfulness of the Slipstreaming process a bit.
      Did anyone of you find a way to integrate this pesky ".NET" Updates into the Image?
      Thanks for the help.

    • By niTe_RiDeR_Pr0
      Macrium Reflect Free Edition v6.1 Build 1225 - Dual x86+x64 RePack by niT€_RiDeR_Pr0
      About RePack: Nothing is removed/added/modified. Only optimized/enhanced & improved the compression, to reduce the file size. [Note: If you download the original (official) setup files, they would be a total of 79.4 MB, after repacking it has been reduced to 41.4 MB, i.e. 38 MB lesser.]
      Optional Command-Line Options:
      DOWNLOAD: Mega | File Name: MacriumReflect_6.1.1225.Dual_RePack.exe | File Size: 41.4 MB  | File Hashes: http://pastebin.com/N2UZWqXN
    • By BusyElf
      After some time spent writing cab addon for larger number of files, i started to look for programs that automate most if not all tasks.
      I found out there are :
      Inf-Addon Maker - haven't found valid DL links (both here and at win-lite)
      DX Universal UpdatePack/Addon Creator (filename DXUPAC.exe DXTool_x64_005FE78D48FC1B11F7068FBBE6FC368A.exe) - DL links present but no options found to select Windows 7. Also at start program requires exe of hotfix/update (which i assumed this program creates as CAB output at end, not requires as input at start)
      Inf-Assistant - no valid DL links
      Are there any usable Win7 INF addon cab makers then ?
      EDIT: I downloaded DXUPAC.exe and it was staring in my face the whole time  :doh:  It is split into several "send to" targets so i did not it see as one single package to work with. Which reminds me : do these pieces of DXUPAC have source code somewhere ?
      I kind of like using Notepad2 and manually assembling the INF files.
  • Create New...