I am trying to create a windows installer .msi file with the wix toolkit that is supposed to be used as an advanced self-extractor. So it is supposed to create some folders and extract files without leaving any other traces on the target system. This means that there will also be no uninstall at all for the package.
Here Microsoft is stating that removing some actions form the InstallExecuteSequence and AdvertiseExecuteSequence tables would do the trick.
adding-and-removing-an-application-and-leaving-no-trace-in-the-registry
Additionally I had to set all the Components GUIDs to a Nullstring to prevent Component registration and I set the DISABLEROLLBACK and MSIFASTINSTALL properties to appropriate values in order to prevent rollback and system restore point data from being stored.
Nevertheless I do not seem to be able to prevent Windows Installer from creating registry entries for each folder it creates. These will all be found under the Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders.
Here is an image of registry values being written and deleted. All values but the values under \Folders are being reset. Meaning the \Folders values will forever be left on the target system.
RegValues written and deleted during installation
Does anyone know a way to prevent Windows Installer from creating these registry entries when creating directories? Or maybe someone knows a workaround to create the directories in another manner, where no registry entries would be set.
Here is the full content of my .wxs file for the wix toolset.
<?xml version='1.0' encoding='windows-1252'?>
<!-- This code has been adapted from firegiant's wix user interface tutorial: https://www.firegiant.com/wix/tutorial/user-interface/first-steps/ -->
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='WixExtract' Id='591E9F05-2F1E-4121-8263-B9ADEDFE0746' UpgradeCode='C017D87A-1C2B-4970-8F4C-BA4DADAB6F2F'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Some Inc.'>
<Package Id='*' Description='WixExtract Test' InstallScope = 'perUser'
Comments='This is a test extractor' Manufacturer='Some Inc.'
InstallerVersion='500' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="WixExtract Test [1]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='WixExtract'>
<!-- add a test file -->
<!-- Setting the GUID to a Nullstring will prevent Components from being registered -->
<Component Id='File1' Guid=''>
<File Id='File1TXT' Name='file1.txt' DiskId='1' Source='file1.txt' KeyPath='no' />
</Component>
<!-- create a test subfolder -->
<Directory Id='SUBFOLDER1' Name='SubFolder1'>
<Component Id="CreateSubFolder1" Guid=""
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="no" Location="either">
<CreateFolder/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature Id='Complete' Title='WixExtract' Description='Everything.'
Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise = 'no'>
<Feature Id='MainProgram' Title='Program' Description='A test file and a folder.' Level='1' AllowAdvertise = 'no'>
<ComponentRef Id='File1' />
<ComponentRef Id='CreateSubFolder1' />
</Feature>
</Feature>
<!-- This should prevent rollback scripts from being created https://learn.microsoft.com/en-us/windows/desktop/msi/-disablerollback -->
<Property Id='DISABLEROLLBACK'>1</Property>
<!-- This should disable system restore points and file costing https://learn.microsoft.com/de-de/windows/desktop/Msi/msifastinstall-->
<Property Id='MSIFASTINSTALL'>4</Property>
<!-- suppressing the following actions severely reduces the reg values being written https://learn.microsoft.com/en-us/windows/desktop/msi/adding-and-removing-an-application-and-leaving-no-trace-in-the-registry -->
<InstallExecuteSequence>
<RegisterProduct Suppress='yes' />
<RegisterUser Suppress='yes' />
<PublishProduct Suppress='yes' />
<PublishFeatures Suppress='yes' />
</InstallExecuteSequence>
<AdvertiseExecuteSequence>
<PublishProduct Suppress='yes' />
<PublishFeatures Suppress='yes' />
</AdvertiseExecuteSequence>
<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />
</Product>
</Wix>