It's too bad that RemoveFile won't work, since it does provide appropriate transacted functionality; that said, the answer to using properties within the command line is to use a custom action to set the property value:
<CustomAction Id="SetAspNet20_Cmd" Property="SetAspNet20" Value=""[NETFRAMEWORK20INSTALLROOTDIR]aspnet_regiis.exe" -ir -enable"/> <CustomAction Id="SetAspNet20" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check"/> <InstallExecuteSequence> <Custom Action="SetAspNet20_Cmd" Before="CostFinalize">NOT (SKIPCONFIGUREIIS OR Installed) AND VersionNT > 400</Custom> <Custom Action="SetAspNet20" Before="ConfigureIIs">NOT (SKIPCONFIGUREIIS OR Installed) AND VersionNT > 400</Custom> </InstallExecuteSequence> in your case: <CustomAction Id="QtExecDeferred_Cmd" Property="QtExecDeferred" Value='"[SystemFolder]\Cmd.exe" /C del /Q "[INSTALLLOCATION]\momo.txt"'/> <CustomAction Id="QtExecDeferred" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/> <InstallExecuteSequence> <Custom Action="QtExecDeferred_Cmd" Before="CostFinalize"/> <Custom Action="QtExecDeferred" After="RemoveExistingProducts"/> </InstallExecuteSequence> Thanks, Thomas S. Trias Senior Developer Artizan Internet Services http://www.artizan.com/ -------- Original Message -------- Subject: Re: [WiX-users] QtExecDeferred and using a property in the cmd line From: MeCoco <vcotirl...@hotmail.com> To: General discussion for Windows Installer XML toolset. <wix-users@lists.sourceforge.net> Date: 11/29/2010 8:25 AM > Hi Peter. > > Thx for your answer, but I can't do that because I need the files to > be removed _only_ when uninstall (not updates) and I have > <RemoveExistingProducts After="InstallInitialize"/>. And as I > described here: > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/BUG-limitation-in-WIX-MSI-No-way-to-distinguish-between-an-uninstall-and-an-update-when-lt-RemoveExi-td5776494.html > > > when REP is after InstallInitialize, it can't be done with Component > conditions. > > So I need a CustomAction which deletes the file and can be conditioned > to happen only when real uninstalls. Because of that I got to the code > below, which doesn't work. > Can somebody pls help me? > > Thanks, > MeCoco > > On 11/29/2010 2:54 PM, Peter Shirtcliffe wrote: >> Use the<RemoveFile> element instead. >> >> >> -----Original Message----- >> From: MeCoco [mailto:vcotirl...@hotmail.com] >> Sent: 29 November 2010 13:45 >> To: General discussion for Windows Installer XML toolset. >> Subject: [WiX-users] QtExecDeferred and using a property in the cmd line >> >> Hi all, >> >> I need to delete a specific file (created by our product) after >> uninstalling the product. For that I'm using the Quiet Execution >> CustomAction like: >> >> <Property Id="QtExecDeferred" Value='"[SystemFolder]\Cmd.exe" /C del /Q >> >> "[INSTALLLOCATION]\momo.txt"'/> >> <CustomAction Id="QtExecDeferred" BinaryKey="WixCA" >> DllEntry="CAQuietExec" Execute="deferred" Return="ignore" >> Impersonate="no"/> >> >> <InstallExecuteSequence> >> <Custom Action="QtExecDeferred" After="RemoveExistingProducts"/> >> </InstallExecuteSequence> >> >> >> When I'm building this I get the following 2 warnings: >> >> warning CNDL1077: The 'QtExecDeferred' Property contains >> '[SystemFolder]' in its value which is an illegal reference to another >> property. If this value is a string literal, not a property reference, >> please ignore this warning. To set a property with the value of another >> >> property, use a CustomAction with Property and Value attributes. >> warning CNDL1077: The 'QtExecDeferred' Property contains >> '[APPLICATIONFOLDER]' in its value which is an illegal reference to >> another property. If this value is a string literal, not a property >> reference, please ignore this warning. To set a property with the value >> >> of another property, use a CustomAction with Property and Value >> attributes. >> >> By looking into the log file, I see that the execution failed, with >> "file not found": >> MSI (s) (4C:28) [14:26:46:842]: Executing op: >> CustomActionSchedule(Action=QtExecDeferred,ActionType=3137,Source=Binary >> Data,Target=CAQuietExec,CustomActionData="[SystemFolder]\Cmd.exe" >> /C del /Q "[INSTALLLOCATION]\momo.txt") >> MSI (s) (4C:80) [14:26:46:853]: Invoking remote custom action. DLL: >> C:\Windows\Installer\MSI8DF2.tmp, Entrypoint: CAQuietExec >> MSI (s) (4C:80) [14:26:46:853]: Generating random cookie. >> MSI (s) (4C:80) [14:26:46:871]: Created Custom Action Server with PID >> 7996 (0x1F3C). >> MSI (s) (4C:4C) [14:26:46:973]: Running as a service. >> MSI (s) (4C:4C) [14:26:46:976]: Hello, I'm your 32bit Elevated custom >> action server. >> CAQuietExec: Error 0x80070002: Command failed to execute. >> CAQuietExec: Error 0x80070002: CAQuietExec Failed >> >> >> I assume the problem is that I'm using [SystemFolder] and >> [INSTALLLOCATION] in a deferred CustomAction. >> >> By searching the internet I found somebody saying: >> "> You can't access properties directly from a defered custom action. >> You >> > have to use another custom action that sets a property matching the >> name of >> > your action." >> >> The problem is that I don't know how to do that? Can someone pls, taking >> >> in account the above lines of code, tell me how and what do I need to >> change to follow this instruction? >> >> Thank you, >> MeCoco >> >> ------------------------------------------------------------------------ >> ------ >> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! >> Tap into the largest installed PC base& get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for >> grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> SDL PLC confidential, all rights reserved. >> If you are not the intended recipient of this mail SDL requests and >> requires that you delete it without acting upon or copying any of its >> contents, and we further request that you advise us. >> SDL PLC is a public limited company registered in England and Wales. >> Registered number: 02675207. >> Registered address: Globe House, Clivemont Road, Maidenhead, >> Berkshire SL6 7DY, UK. >> >> >> ------------------------------------------------------------------------------ >> >> >> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! >> Tap into the largest installed PC base& get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for >> grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> > > > ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users