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="QtExecDeferred1">REMOVE="ALL" AND NOT 
> UPGRADINGPRODUCTCODE</Custom>
> <Custom Action="QtExecDeferred1" 
> After="RemoveExistingProducts">REMOVE="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 that makes 
> it behave differently than my test-sample. The installer has million 
> of files that take care to install millions of binaries and I tried to 
> check to see where exactly the problem is, but I was not able to find 
> anything useful which would explain why on uninstall the 
> INSTALLLOCATION is wrong. I also tried to create a small sample in 
> order to reproduce the problem, but also without success: in all my 
> samples this works ok (INSTALLLOCATION is the correct one on 
> uninstall). Can smbd pls point out some hints or places where I could 
> look? I will put below the code-snippet that is related to that and I 
> will attach the log file. In the log file, the default installation 
> path is: C:\Program Files and the path chosen by the user during 
> install is: Z:\Program Files. The log is a verbose log of the 
> uninstall. Any hint is more than welcome!
>
> Code snippets:
> ================
>
> <CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" 
> Value="[INSTALLLOCATION]" />
>
> <!-- Sequences -->
> <InstallExecuteSequence>
> <Custom Action="SetARPINSTALLLOCATION" After="InstallValidate">NOT 
> Installed</Custom>
> </InstallExecuteSequence>
>
>
> <Directory Id="TARGETDIR" Name="SourceDir">
> <Directory Id="ProgramFilesFolder">
> <Directory Id="INSTALLLOCATION" Name="MyInstallDir">
> <Directory Id="Modules" Name="Modules">
>
> </Directory>
> </Directory>
> </Directory>
> </Directory>
>
>
> <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="QtExecDeferred1">REMOVE="ALL" AND NOT 
> UPGRADINGPRODUCTCODE</Custom>
> <Custom Action="QtExecDeferred1" 
> After="RemoveExistingProducts">REMOVE="ALL" AND NOT 
> UPGRADINGPRODUCTCODE</Custom>
> </InstallExecuteSequence>
>
>
> <Property Id="INSTALLLOCATION">
> <RegistrySearch Id="FindInstallLocation" Root="HKLM" 
> Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDAPPFOUND]" 
> Name="InstallLocation" 
> Type="raw" />
> </Property>
>
> <Upgrade Id="$(var.UpgradeCode)">
> <UpgradeVersion Property="OLDAPPFOUND" IncludeMinimum="yes" 
> Minimum="2.0.0.0" IncludeMaximum="no" 
> Maximum="!(bind.FileVersion.MyApp.Binaries.$(var.MyApp.TargetFileName))"/>
>         ...
> </Upgrade>
>
>
>
> <!-- application features -->
> <Feature Id="Application" Title="$(var.ProductName) Application" 
> Level="1" Absent="disallow">
> <ComponentGroupRef Id="MyApp.Binaries" />
> <ComponentGroupRef Id="_3rdParty.Binaries"/>
> <ComponentGroupRef Id="MyApp.Splash.Binaries"/>
> <ComponentRef Id="ApplicationShortcut"/>
> </Feature>
> <Feature Id="Modules" Title="$(var.ProductName) My Modules" Level="1" 
> TypicalDefault="install">
> <FeatureRef Id="Module.Audio" />
> <FeatureRef Id="Module.Video" />
> </Feature>
>
>
>
> <Fragment>
> <Feature Id="Module.Video" Title="Webcam &amp; Screen Capturing" 
> Level="1" Absent="allow" InstallDefault="followParent">
> <ComponentGroupRef Id="Video.Binaries"/>
> <ComponentGroupRef Id="Video.Content"/>
> </Feature>
> </Fragment>
> <Fragment>
> <ComponentGroup Id="Video">
> <Component Id="Video.Binaries.Modules.Video.dll" 
> Directory="Video.Binaries" Guid="{25E366B3-95D4-459C-91BA-EDFBC2D7104D}">
> <File Id="Video.Binaries.Modules.Video.dll" 
> Source="$(var.Video.TargetDir)\Modules.Video.dll" />
> </Component>
> <Component Id="Video.Content.Video.png" 
> Directory="Video.Content.Resources" 
> Guid="{8B99C3D5-5C84-49B7-961B-2A0B8DAB6AC5}">
> <File Id="Video.Content.Video.png" 
> Source="$(var.Video.ProjectDir)\Resources\Video.png" />
> </Component>
> <Component Id="Video.Content.vidSmall.png" 
> Directory="Video.Content.Resources" 
> Guid="{E0FB9672-27B5-42C1-9AF5-783BB9E6852D}">
> <File Id="Video.Content.vidSmall.png" 
> Source="$(var.Video.ProjectDir)\Resources\vidSmall.png" />
> </Component>
> <Component Id="Video.Content.sample_screen.bmp" 
> Directory="Video.Content.Resources" 
> Guid="{877913CE-D40F-4233-8F3F-9F3171BEAB81}">
> <File Id="Video.Content.sample_screen.bmp" 
> Source="$(var.Video.ProjectDir)\Resources\sample-screen.bmp" />
> </Component>
> <Component Id="Video.Content.sample_webcam.bmp" 
> Directory="Video.Content.Resources" 
> Guid="{6FDD639B-3310-4DF8-AA8C-4553AA43D182}">
> <File Id="Video.Content.sample_webcam.bmp" 
> Source="$(var.Video.ProjectDir)\Resources\sample-webcam.bmp" />
> </Component>
> <Component Id="Video.Content.Screen.png" 
> Directory="Video.Content.Resources" 
> Guid="{0BD1BA3A-6485-4899-AC85-6DEA461D02F2}">
> <File Id="Video.Content.Screen.png" 
> Source="$(var.Video.ProjectDir)\Resources\Screen.png" />
> </Component>
> <Component Id="Video.Content.screenSmall.png" 
> Directory="Video.Content.Resources" 
> Guid="{9D9C6C86-110B-4ddc-A1F8-AEE388B4B195}">
> <File Id="Video.Content.screenSmall.png" 
> Source="$(var.Video.ProjectDir)\Resources\screenSmall.png" />
> </Component>
> <Component Id="Video.Content.Cam.png" 
> Directory="Video.Content.Resources" 
> Guid="{27785913-9433-4ff6-9E62-17DC1AEDDD52}">
> <File Id="Video.Content.Cam.png" 
> Source="$(var.Video.ProjectDir)\Resources\Cam.png" />
> </Component>
> <Component Id="Video.Content.camSmall.png" 
> Directory="Video.Content.Resources" 
> Guid="{CD13E295-3077-4353-A68E-ACBD3A333C94}">
> <File Id="Video.Content.camSmall.png" 
> Source="$(var.Video.ProjectDir)\Resources\camSmall.png" />
> </Component>
> </ComponentGroup>
> </Fragment>
> <Fragment>
> <DirectoryRef Id="Video.Binaries" />
> </Fragment>
> <Fragment>
> <ComponentGroup Id="Video.Binaries">
> <ComponentRef Id="Video.Binaries.Modules.Video.dll" />
> </ComponentGroup>
> </Fragment>
> <Fragment>
> <DirectoryRef Id="Video.Content">
> <Directory Id="Video.Content.Resources" Name="Resources" />
> </DirectoryRef>
> </Fragment>
> <Fragment>
> <ComponentGroup Id="Video.Content">
> <ComponentRef Id="Video.Content.Video.png" />
> <ComponentRef Id="Video.Content.vidSmall.png" />
> <ComponentRef Id="Video.Content.sample_screen.bmp" />
> <ComponentRef Id="Video.Content.sample_webcam.bmp" />
> <ComponentRef Id="Video.Content.Screen.png" />
> <ComponentRef Id="Video.Content.screenSmall.png" />
> <ComponentRef Id="Video.Content.Cam.png" />
> <ComponentRef Id="Video.Content.camSmall.png" />
> </ComponentGroup>
> </Fragment>
> <Fragment>
> <DirectoryRef Id="Modules">
> <Directory Id="Video.Binaries" />
> </DirectoryRef>
> </Fragment>
> <Fragment>
> <DirectoryRef Id="Modules">
> <Directory Id="Video.Content" />
> </DirectoryRef>
> </Fragment>
> </Wix>
>
>
> Thank you in advance!
> 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

------------------------------------------------------------------------------
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

Reply via email to