[wix-users] (no subject)

Todd Hoatson todd.hoatson at gmail.com
Sat Nov 3 15:38:11 PDT 2018


Hi Edwin,
  sorry for the delayed reply.  Lots going on, and I needed to think
through your reply for a while...

> Why should the installer create this directory if the application should
create this folder?

A very simple reason - the application cannot create this folder.  This
folder must exist so the installer can set it as the WorkingDirectory when
it creates the shortcut for the app.  If that folder does not exist at
install time, how can the shortcut be created?  And if the shortcut can't
be created with a valid WorkingDirectory, how can my app be run?

> The installer can only create that per-user directory for the user that
runs the installer.
> If the application is every run by any other user, then the directory
will not exist anyway
> and the application will need to create it itself if the application
wants to write a file to
> that directory.

Took me a while to understand your point, but I think I do now.  And I
think your point is a good one.  I simply don't know how to work around the
creation of the shortcut if the WorkingDirectory is created by my app...

> If the installer should create the per-user directory, then the ICE
warning is telling you
> that the per-user component cannot use a file (directory in this case) as
the key path
> but instead it should use a registry key under HKCU as the key path. The
key path is
> used as one bit to determine whether a component is installed or not by
the Windows
> Installer Engine.

Not sure I understand this one, yet.  Why does the registry play a part in
this?  Is it because the registry contains a key to indicate what the user
directory is?  What registry key do I use?

> The other ICE warning suggests you should add the directory to the
RemoveFile table
> so that it gets removed at uninstall time *but* the per-user directory
for the user
> uninstalling the MSI will be deleted so you could still leave behind
configuration
> data behind if other users run the application.

We don't want the directory to be removed.  If the user is doing a
reinstall or installing a newer version, then we want to pick up any
pre-existing configuration.  Uninstall should never remove this.

> Should this configuration file really exist on a per-user basis? If yes,
then you'll likely
> need to leave them behind at uninstall anyway.

Exactly.

> And since the application will need to create the directory if it doesn't
exist, then it
> should just be responsible for creating the directory instead of the
installer.

No can do, for the above reasons.  Unless you can suggest a way around the
creation of the shortcut...

thanks,
Todd

On Fri, Oct 26, 2018 at 3:04 PM Edwin Castro <egcastr at gmail.com> wrote:

> The ICE warnings are trying to help you author a correct MSI package but
> it doesn't know the details of how the application works so the warnings
> should be ignored intentionally because you've analyzed them and decided
> they do not apply in your situation. The WiX linker is reporting the ICE
> warnings as errors likely because you told it to treat all warnings as
> errors.
>
> Why should the installer create this directory if the application should
> create this folder? The installer can only create that per-user directory
> for the user that runs the installer. If the application is every run by
> any other user, then the directory will not exist anyway and the
> application will need to create it itself if the application wants to write
> a file to that directory.
>
> If the installer should create the per-user directory, then the ICE
> warning is telling you that the per-user component cannot use a file
> (directory in this case) as the key path but instead it should use a
> registry key under HKCU as the key path. The key path is used as one bit to
> determine whether a component is installed or not by the Windows Installer
> Engine.
>
> The other ICE warning suggests you should add the directory to the
> RemoveFile table so that it gets removed at uninstall time *but* the
> per-user directory for the user uninstalling the MSI will be deleted so you
> could still leave behind configuration data behind if other users run the
> application.
>
> Should this configuration file really exist on a per-user basis? If yes,
> then you'll likely need to leave them behind at uninstall anyway. And since
> the application will need to create the directory if it doesn't exist, then
> it should just be responsible for creating the directory instead of the
> installer.
>
> --
> Edwin G. Castro
>
>
> On Fri, Oct 26, 2018 at 10:19 AM Todd Hoatson via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
>> Hi,
>>   I have created an installer, and it works.  In spite of the fact that I
>> get error messages, it still creates a working installer that pretty much
>> does what I want it to do.  But I would like to understand why I'm getting
>> these error messages, and how to fix my WiX code so these error messages
>> go
>> away.  (They make my coworkers nervous.)
>>
>> Here are the error messages:
>>
>> error LGHT0204 : ICE38: Component EmptyWorkingDIR installs to user
>> profile.
>> It must use a registry key under HKCU as its KeyPath, not a file.
>> error LGHT0204 : ICE64: The directory WorkingFolder is in the user profile
>> but is not listed in the RemoveFile table.
>>
>> Here are (what I believe to be) the relevant lines from my WiX code:
>>
>>     <Directory Id="TARGETDIR" Name="SourceDir">
>>         ...
>>         <Directory Id="PersonalFolder">
>>             <Directory Id="WorkingFolder" Name="BART5" />
>>         </Directory>
>>     </Directory>
>>     ...
>>     <DirectoryRef Id="WorkingFolder">
>>         <Component Id="EmptyWorkingDIR"
>>                    Guid="0c25a284-3f3a-491a-96da-3d926a3e5f09"
>>                    KeyPath="yes" >
>>             <CreateFolder />
>>         </Component>
>>     </DirectoryRef>
>>
>> Our application looks for a configuration file in the working folder.  If
>> it's not there, it uses the default settings, then saves its configuration
>> on exit.  So, we simply want the installer to create this empty folder.
>>
>> Am I doing this wrong?  It works, but it gives me these errors, which I
>> would like to eliminate.  Any suggestions?
>>
>> thanks,
>> Todd Hoatson
>> Mobile: 763-291-3312
>> Email:   todd.hoatson at gmail.com
>> www.linkedin.com/in/toddhoatson
>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant
>> http://www.firegiant.com/
>>
>

-- 
Todd Hoatson
Mobile: 763-291-3312
Email:   todd.hoatson at gmail.com
www.linkedin.com/in/toddhoatson


More information about the wix-users mailing list