I used the following code to make a file NOT get deleted during an uninstall:
<Condition Level="0">
<![CDATA[REMOVE = "ALL"]]>
</Condition>
But I guess since I put it in the same which has the of some other files, it made the other files Not uninstallable as well.
<Feature Id="Config_File" Title="Configuration File" Level="1">
<ComponentRef Id="ProductComponents" />
<ComponentRef Id="Executable" />
<ComponentRef Id="Config_File" />
<Condition Level="0">
<![CDATA[REMOVE = "ALL"]]>
</Condition>
</Feature>
... I also had set the Permanent tag to "yes" for the file I wanted to NOT get deleted during an uninstall:
<Component Id="Config_File" Guid="*" Permanent="yes" NeverOverwrite="yes">
<File Id="ApplicationConfigFile" Name="application.config" Source=".\application.config" Vital="yes" />
</Component>
My question is: how do I make these files uninstalable again?
- setting "Level" in the Condition to "0" didn't work either.
setting "permanent" to "no" didn't work.
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> <!--MediaTemplate /--> <Media Id="1" Cabinet="SOPHATEL_Server_Management.cab" EmbedCab="yes" /> <Feature Id="ProductFeature" Title="SOPHATEL Server Management" Level="1"> <!--ComponentGroupRef Id="ProductComponents" /--> <ComponentRef Id="ProductComponents" /> <ComponentRef Id="ProductComponents2" /> <ComponentRef Id="Executable" /> </Feature> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<Fragment> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLFOLDER" Name="SOPHATEL Server Management" /> </Directory> </Directory> </Fragment> <Fragment> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> <Component Id="ProductComponents" Guid="f5207608-9c81-4317-89de-061066ec863c"> <File Id="WebAPISelfHostingExe" Name="WebAPISelfHosting.exe" Source="..\WebAPISelfHosting\bin\Debug\WebAPISelfHosting.exe" Vital="yes" /> </Component> <Component Id="ProductComponents2" Guid="f5207608-9c81-4317-89de-061066ec863d" NeverOverwrite="yes"> <File Id="configFile" Name="application.config" Source=".\application.config" Vital="yes" /> </Component> <!--Component Id="icon.ico" Guid="7805267a-624b-41e7-baaf-49b82c0439cc"> <File Id='icon.ico' Name='icon.ico' Source="..\WixInstall\icon.ico" KeyPath='yes' /> </Component--> <Component Id="Executable" Guid="f5207608-9c81-4317-89de-061066ec863e"> <File Id="Service_testExe" Name="Service_test.exe" Source="..\Service_test\bin\Debug\Service_test.exe" Vital="yes" /> <!-- Remove all files from the INSTALLFOLDER on uninstall --> <RemoveFile Id="ALLFILES" Name="*.*" On="both" /> <!-- Remove INSTALLFOLDER on uninstall --> <RemoveFolder Id="INSTALLDIR" On="uninstall" /> <!-- Tell WiX to install the Service --> <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="Service_test" DisplayName="Service_test" Description="A Test Service that logs dummy text on an interval to a text file." Start="auto" ErrorControl="normal" /> <!-- Tell WiX to start the Service --> <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="Service_test" Wait="yes" /> </Component> </ComponentGroup>
All files are NOT uninstallable now, I want to be uninstallable again.