[wix-users] How to conditionally remove configuration?

Hoover, Jacob Jacob.Hoover at greenheck.com
Wed May 13 08:53:20 PDT 2020


From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Markus Kramer via wix-users
Sent: Wednesday, May 13, 2020 10:45 AM
To: wix-users at lists.wixtoolset.org
Cc: Markus Kramer <markuskramerigitt at gmail.com>
Subject: Re: [wix-users] How to conditionally remove configuration?

sadly, I am unable to use RemoveFile conditionally in the wxs file below.
Is REMOVE_CONFIG not yet present when RemoveFile is scheduled?

Thank you,

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi<http://schemas.microsoft.com/wix/2006/wi>">
Name='Foobar 1.0'
Manufacturer='Acme Ltd.'
<Package InstallerVersion='450' Compressed='yes'
InstallScope="perMachine" />
<MediaTemplate EmbedCab="yes" />
<!-- With SetProperty, the commandline property REMOVE_CONFIG=1 has no
effect -->
<!-- <SetProperty Id="REMOVE_CONFIG" Value="0"
Before="CostInitialize"/> -->
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='Acme' Name='Acme'>
<Directory Id='INSTALLFOLDER' Name='FoobarBin'>
<Component Id='MainExecutable'>
<File Id='FoobarEXE' Name='FoobarAppl10.exe'
Source='FoobarAppl10.exe' KeyPath='yes'/>
<Directory Id='CONFIGFOLDER' Name='FoobarConf'>
<Component Id="RmConfComponent" Transitive='yes'
<!-- The commandline property REMOVE_CONFIG=1 has no effect
on RemoveFile
Maybe because msi schedules properties after Remove Files?
Transitive='yes' added because of

<CreateFolder />
<RemoveFile Name="*.*" On="uninstall" Id="RmConfig"/>
<RemoveFolder Id="CONFIGFOLDER" On="uninstall"/>
<Feature Id='Complete'>
<ComponentRef Id='MainExecutable'/>
<ComponentRef Id='RmConfComponent'/>

On Tue, May 12, 2020 at 5:19 PM Markus Kramer <markuskramerigitt at gmail.com<mailto:markuskramerigitt at gmail.com>>

> Greetings,
> I use custom actions to remove configuration on uninstall, depending on an
> property (REMOVE_CONFIG)
> I would like to replace my custom actions with RemoveFolderEx but
> RemoveFolderEx is called so early, that there are no properties yet.
> How could you make RemoveFolderEx depend on a user property?
> E.g. could I call RemoveFolderEx from my custom action?
> Can RemoveFolder (without Ex) depend on a user property?
> Is there a best practice for configuration data?
> Thank you,
> Markus
> P.S. I tried to search the mail archive but was unable to use the
> search function.

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/<http://www.firegiant.com>
NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.

More information about the wix-users mailing list