Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
Thank you guys for all your help! MeCoco On 3/9/2011 4:19 PM, David Watson wrote: If you have a directory element with no @Name it just makes the @Id an alias of the containing element. So your code makes any files targeted to MyApp.Binaries go in the same location as INSTALLDIR. -Original Message- From: MeCoco [mailto:vcotirl...@hotmail.com] Sent: 09 March 2011 15:03 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one) Hi Michael, Thanks again for the explanation. Could you also tell me please what are the following lines of code actually do?: DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef Thanks! MeCoco On 3/9/2011 3:08 PM, Michael Urman wrote: That doesn't look like it creates a component whose Directory is INSTALLDIR. It may put the component's file in the same directory, but since custom actions could override this, it doesn't count. What you need is the Directory_ column of the Component table to say INSTALLDIR instead of MyApp.Binaries, for at least one installed component. On Wed, Mar 9, 2011 at 02:29, MeCocovcotirl...@hotmail.com wrote: Hi Michael, Thanks for your answer. Is the following code not enough to preserve the INSTALLDIR directory? Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment Fragment Component Id=MyApp.Binaries.app.config Directory=MyApp.Binaries Guid=MY-GUID File Id=MyApp.Binaries.app.config Source=MyApp.app.config / /Component /Fragment As the file MyApp.app.config ends up going into the INSTALLLOCATION directory? I am not even sure what the: Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment is doing as the: Directory Id=MyApp.Binaries / doesn't have any Name parameter, so it looks like redefining MyApp.Binaries to be the INSTALLDIR value. Am I assuming correct? Thanks, MeCoco On 3/8/2011 3:07 PM, Michael Urman wrote: Directories are only automatically preserved when there is a component that installs to it. So make sure at least one component installs to INSTALLDIR. On Tue, Mar 8, 2011 at 03:31, MeCocovcotirl...@hotmail.com wrote: Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new
Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
And yes, just to be clear, once I added a component under the INSTALLDIR (not one of it's alias) the INSTALLDIR was also correctly preserved for uninstall. Thx, MeCoco On 3/10/2011 10:39 AM, MeCoco wrote: Thank you guys for all your help! MeCoco On 3/9/2011 4:19 PM, David Watson wrote: If you have a directory element with no @Name it just makes the @Id an alias of the containing element. So your code makes any files targeted to MyApp.Binaries go in the same location as INSTALLDIR. -Original Message- From: MeCoco [mailto:vcotirl...@hotmail.com] Sent: 09 March 2011 15:03 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one) Hi Michael, Thanks again for the explanation. Could you also tell me please what are the following lines of code actually do?: DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef Thanks! MeCoco On 3/9/2011 3:08 PM, Michael Urman wrote: That doesn't look like it creates a component whose Directory is INSTALLDIR. It may put the component's file in the same directory, but since custom actions could override this, it doesn't count. What you need is the Directory_ column of the Component table to say INSTALLDIR instead of MyApp.Binaries, for at least one installed component. On Wed, Mar 9, 2011 at 02:29, MeCocovcotirl...@hotmail.comwrote: Hi Michael, Thanks for your answer. Is the following code not enough to preserve the INSTALLDIR directory? Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment Fragment Component Id=MyApp.Binaries.app.config Directory=MyApp.Binaries Guid=MY-GUID File Id=MyApp.Binaries.app.config Source=MyApp.app.config / /Component /Fragment As the file MyApp.app.config ends up going into the INSTALLLOCATION directory? I am not even sure what the: Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment is doing as the: Directory Id=MyApp.Binaries / doesn't have any Name parameter, so it looks like redefining MyApp.Binaries to be the INSTALLDIR value. Am I assuming correct? Thanks, MeCoco On 3/8/2011 3:07 PM, Michael Urman wrote: Directories are only automatically preserved when there is a component that installs to it. So make sure at least one component installs to INSTALLDIR. On Tue, Mar 8, 2011 at 03:31, MeCocovcotirl...@hotmail.com wrote: Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its
Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
Hi Michael, Thanks for your answer. Is the following code not enough to preserve the INSTALLDIR directory? Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment Fragment Component Id=MyApp.Binaries.app.config Directory=MyApp.Binaries Guid=MY-GUID File Id=MyApp.Binaries.app.config Source=MyApp.app.config / /Component /Fragment As the file MyApp.app.config ends up going into the INSTALLLOCATION directory? I am not even sure what the: Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment is doing as the: Directory Id=MyApp.Binaries / doesn't have any Name parameter, so it looks like redefining MyApp.Binaries to be the INSTALLDIR value. Am I assuming correct? Thanks, MeCoco On 3/8/2011 3:07 PM, Michael Urman wrote: Directories are only automatically preserved when there is a component that installs to it. So make sure at least one component installs to INSTALLDIR. On Tue, Mar 8, 2011 at 03:31, MeCocovcotirl...@hotmail.com wrote: Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new value: 'Z:\Program Files\MyTestInstallDirectory\Modules\'. Is this a bug or am I doing something wrong? I think in both cases the INSTALLDIR should have the correct value (Z:\Program Files\...) on uninstall. Any tip is appreciated. Thank you, MeCoco On 3/7/2011 7:24 PM, MeCoco wrote: Hi all, I have a very extensive installer, written by somebody that left our company, and I have to add a custom action that should be executed at the end of the uninstaller (only when completely removed from control panel, not in case of an update) in order to remove a file that was at a later point created by our product. I wrote a small test-installer to do just that and everything works fine: the custom action that should delete a specific file from the installation directory is run at the end of the uninstallation: CustomAction Id=QtExecDeferred_Cmd1 Property=QtExecDeferred1 Value='[SystemFolder]Cmd.exe /C del /Q [INSTALLLOCATION ]MyLogo.txt'/ CustomAction Id=QtExecDeferred1 BinaryKey=WixCA DllEntry=CAQuietExec Execute=deferred Return=ignore Impersonate=no/ InstallExecuteSequence Custom Action=QtExecDeferred_Cmd1 Before=QtExecDeferred1REMOVE=ALL AND NOT UPGRADINGPRODUCTCODE/Custom Custom Action=QtExecDeferred1
Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
That doesn't look like it creates a component whose Directory is INSTALLDIR. It may put the component's file in the same directory, but since custom actions could override this, it doesn't count. What you need is the Directory_ column of the Component table to say INSTALLDIR instead of MyApp.Binaries, for at least one installed component. On Wed, Mar 9, 2011 at 02:29, MeCoco vcotirl...@hotmail.com wrote: Hi Michael, Thanks for your answer. Is the following code not enough to preserve the INSTALLDIR directory? Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment Fragment Component Id=MyApp.Binaries.app.config Directory=MyApp.Binaries Guid=MY-GUID File Id=MyApp.Binaries.app.config Source=MyApp.app.config / /Component /Fragment As the file MyApp.app.config ends up going into the INSTALLLOCATION directory? I am not even sure what the: Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment is doing as the: Directory Id=MyApp.Binaries / doesn't have any Name parameter, so it looks like redefining MyApp.Binaries to be the INSTALLDIR value. Am I assuming correct? Thanks, MeCoco On 3/8/2011 3:07 PM, Michael Urman wrote: Directories are only automatically preserved when there is a component that installs to it. So make sure at least one component installs to INSTALLDIR. On Tue, Mar 8, 2011 at 03:31, MeCocovcotirl...@hotmail.com wrote: Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new value: 'Z:\Program Files\MyTestInstallDirectory\Modules\'. Is this a bug or am I doing something wrong? I think in both cases the INSTALLDIR should have the correct value (Z:\Program Files\...) on uninstall. Any tip is appreciated. Thank you, MeCoco On 3/7/2011 7:24 PM, MeCoco wrote: Hi all, I have a very extensive installer, written by somebody that left our company, and I have to add a custom action that should be executed at the end of the uninstaller (only when completely removed from control panel, not in case of an update) in order to remove a file that was at a later point created by our product. I wrote a small test-installer to do just that and everything works fine: the custom action that should delete a specific file from the installation directory is run at the end of the uninstallation:
Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
Hi Michael, Thanks again for the explanation. Could you also tell me please what are the following lines of code actually do?: DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef Thanks! MeCoco On 3/9/2011 3:08 PM, Michael Urman wrote: That doesn't look like it creates a component whose Directory is INSTALLDIR. It may put the component's file in the same directory, but since custom actions could override this, it doesn't count. What you need is the Directory_ column of the Component table to say INSTALLDIR instead of MyApp.Binaries, for at least one installed component. On Wed, Mar 9, 2011 at 02:29, MeCocovcotirl...@hotmail.com wrote: Hi Michael, Thanks for your answer. Is the following code not enough to preserve the INSTALLDIR directory? Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment Fragment Component Id=MyApp.Binaries.app.config Directory=MyApp.Binaries Guid=MY-GUID File Id=MyApp.Binaries.app.config Source=MyApp.app.config / /Component /Fragment As the file MyApp.app.config ends up going into the INSTALLLOCATION directory? I am not even sure what the: Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment is doing as the: Directory Id=MyApp.Binaries / doesn't have any Name parameter, so it looks like redefining MyApp.Binaries to be the INSTALLDIR value. Am I assuming correct? Thanks, MeCoco On 3/8/2011 3:07 PM, Michael Urman wrote: Directories are only automatically preserved when there is a component that installs to it. So make sure at least one component installs to INSTALLDIR. On Tue, Mar 8, 2011 at 03:31, MeCocovcotirl...@hotmail.comwrote: Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new value: 'Z:\Program Files\MyTestInstallDirectory\Modules\'. Is this a bug or am I doing something wrong? I think in both cases the INSTALLDIR should have the correct value (Z:\Program Files\...) on uninstall. Any tip is appreciated. Thank you, MeCoco On 3/7/2011 7:24 PM, MeCoco wrote: Hi all, I have a very extensive installer, written by somebody that left our company, and I have to add a custom action that should be executed at the end of the uninstaller (only when completely removed from control panel, not in case of an update) in order to remove a file
Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
If you have a directory element with no @Name it just makes the @Id an alias of the containing element. So your code makes any files targeted to MyApp.Binaries go in the same location as INSTALLDIR. -Original Message- From: MeCoco [mailto:vcotirl...@hotmail.com] Sent: 09 March 2011 15:03 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one) Hi Michael, Thanks again for the explanation. Could you also tell me please what are the following lines of code actually do?: DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef Thanks! MeCoco On 3/9/2011 3:08 PM, Michael Urman wrote: That doesn't look like it creates a component whose Directory is INSTALLDIR. It may put the component's file in the same directory, but since custom actions could override this, it doesn't count. What you need is the Directory_ column of the Component table to say INSTALLDIR instead of MyApp.Binaries, for at least one installed component. On Wed, Mar 9, 2011 at 02:29, MeCocovcotirl...@hotmail.com wrote: Hi Michael, Thanks for your answer. Is the following code not enough to preserve the INSTALLDIR directory? Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment Fragment Component Id=MyApp.Binaries.app.config Directory=MyApp.Binaries Guid=MY-GUID File Id=MyApp.Binaries.app.config Source=MyApp.app.config / /Component /Fragment As the file MyApp.app.config ends up going into the INSTALLLOCATION directory? I am not even sure what the: Fragment DirectoryRef Id=INSTALLDIR Directory Id=MyApp.Binaries / /DirectoryRef /Fragment is doing as the: Directory Id=MyApp.Binaries / doesn't have any Name parameter, so it looks like redefining MyApp.Binaries to be the INSTALLDIR value. Am I assuming correct? Thanks, MeCoco On 3/8/2011 3:07 PM, Michael Urman wrote: Directories are only automatically preserved when there is a component that installs to it. So make sure at least one component installs to INSTALLDIR. On Tue, Mar 8, 2011 at 03:31, MeCocovcotirl...@hotmail.comwrote: Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new value: 'Z:\Program Files\MyTestInstallDirectory\Modules\'. Is this a bug or am I doing something wrong? I
Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new value: 'Z:\Program Files\MyTestInstallDirectory\Modules\'. Is this a bug or am I doing something wrong? I think in both cases the INSTALLDIR should have the correct value (Z:\Program Files\...) on uninstall. Any tip is appreciated. Thank you, MeCoco On 3/7/2011 7:24 PM, MeCoco wrote: Hi all, I have a very extensive installer, written by somebody that left our company, and I have to add a custom action that should be executed at the end of the uninstaller (only when completely removed from control panel, not in case of an update) in order to remove a file that was at a later point created by our product. I wrote a small test-installer to do just that and everything works fine: the custom action that should delete a specific file from the installation directory is run at the end of the uninstallation: CustomAction Id=QtExecDeferred_Cmd1 Property=QtExecDeferred1 Value='[SystemFolder]Cmd.exe /C del /Q [INSTALLLOCATION ]MyLogo.txt'/ CustomAction Id=QtExecDeferred1 BinaryKey=WixCA DllEntry=CAQuietExec Execute=deferred Return=ignore Impersonate=no/ InstallExecuteSequence Custom Action=QtExecDeferred_Cmd1 Before=QtExecDeferred1REMOVE=ALL AND NOT UPGRADINGPRODUCTCODE/Custom Custom Action=QtExecDeferred1 After=RemoveExistingProductsREMOVE=ALL AND NOT UPGRADINGPRODUCTCODE/Custom /InstallExecuteSequence The problem is that when I try to integrate the exact same code into the big installer this doesn't work anymore. The installer is a WIXUI_INSTALLDIR. I generated a verbose log file and I noticed that the INSTALLLOCATION property is wrong when uninstalling the product, instead of being the real directory where the product was installed (chosen by the user, eg: Z:\momo) is actually the default directory (eg: C:\Program Files\MyApp), so the file that needs to be deleted: [INSTALLLOCATION]MyLogo.txt is not found because the INSTALLLOCATION is not correct. Weird is, that only in the uninstall case, the INSTALLLOCATION property is wrong. In case of an update it looks ok (eg Z:\momo). As one can see in the attached log file, some paths there are the correct ones: Z:\Program Files\... and some are the wrong ones: C:\Program Files\... As the INSTALLLOCATION is correct in my small test-installer during uninstall, it is smth in this big and extensive installer
[WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one)
I ran into this issue in the past and couldn't quite figure out what is the cause of the problem. But looking at your re-pro steps, looks like simply having a file being present in the INSTALLLOCATION root directory would force the INSTALLLOCATION to be properly updated. I'm wondering if you go back to your original complicated project and try to inject a dummy file to the INSTALLLOCATION root directory, would that also force the INSTALLLOCATION property to be updated in your original project? Just wondering. John Leung -Original Message- Message: 3 Date: Tue, 8 Mar 2011 10:31:20 +0100 From: MeCoco vcotirl...@hotmail.com Subject: Re: [WiX-users] INSTALLLOCATION wrong value during uninstall (has the default value, not the used one) To: General discussion for Windows Installer XML toolset. wix-users@lists.sourceforge.net Message-ID: blu0-smtp2092d3c38f74d0d7bc3bdd483...@phx.gbl Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi all, I tried to create a small sample to reproduce the problem I'm having, and after a lot of tries I managed to reproduce it. The problem is described extensivly in my previous email, but a summary would be: if the user, when installing, changes the default directory (eg: from C:\Program Files\... to Z:\Program Files\...), then on uninstall (only real uninstall, not updates) one can see in the verbose log file that the INSTALLDIR property is set wrong to the default value (eg: C:\Program Files\...) and not to the folder where the user really installed the product (eg: Z:\Program Files\...) HOW to reproduce the problem: 1) If in the code I have the following: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Component Id=MyDoc.txt Guid=6817A42D-30E7-464C-99DC-8FDBED6D70C6 File Id=MyDoc.txt Source=MyDoc.txt KeyPath=yes Checksum=yes / /Component Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / ComponentRef Id=MyDoc.txt / /Feature I get everything correct, meaning I have in the log file the following: MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'Z:\Program Files\MyTestInstallDirectory'. MSI (s) (08:24) [10:13:46:801]: PROPERTY CHANGE: Adding Modules property. Its value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. 2) BUT, if in the code the MyDoc.txt component is missing, the INSTALLDIR property is wrong. So, for the code: Directory Id=TARGETDIR Name=SourceDir Directory Id=ProgramFilesFolder Directory Id=INSTALLDIR Name=$(var.InstallDirectoryName) Directory Id=Modules Name=Modules Component Id=MyLogo.txt Guid=68C1561C-85F8-4E2F-81F4-41DDDBE35DDB File Id=MyLogo.txt Source=MyLogo.txt KeyPath=yes Checksum=yes / /Component /Directory /Directory /Directory /Directory !-- application features -- Feature Id=Application Title=$(var.ProductName) Application Level=1 Absent=disallow ComponentRef Id=MyLogo.txt / /Feature In the log file I can see: MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\MyTestInstallDirectory\'. MSI (s) (08:B0) [10:16:49:444]: PROPERTY CHANGE: Modifying Modules property. Its current value is 'Z:\Program Files\MyTestInstallDirectory\Modules'. Its new value: 'Z:\Program Files\MyTestInstallDirectory\Modules\'. Is this a bug or am I doing something wrong? I think in both cases the INSTALLDIR should have the correct value (Z:\Program Files\...) on uninstall. Any tip is appreciated. Thank you, MeCoco -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users