wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 24 forks source link

Generated components should be ICE-clean for per-user target directories #8633

Open EvgenPervenenko opened 3 months ago

EvgenPervenenko commented 3 months ago

WiX Version

5.0.0

.NET or MSBuild or Visual Studio Version

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.2

HeatWave Version

1.0.4

Windows Version

Windows 11 Pro 21H2

Repro Repo

No response

Repro Steps

Folder (in my example) contains some files d:\TestFolder

Project Wix msi structure:

ExampleComponents.wxs

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Fragment>
    <ComponentGroup Id="ExampleComponents" Directory="INSTALLFOLDER">
      <Files Include="d:\TestFolder\\**" />
    </ComponentGroup>
  </Fragment>
</Wix>

Folders.wxs

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Fragment>
    <StandardDirectory Id="AppDataFolder">
      <Directory Id="INSTALLFOLDER" Name="!(bind.Property.Manufacturer) !(bind.Property.ProductName)" />
    </StandardDirectory>
  </Fragment>
</Wix>

Package.wxs

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Package Name="Package1" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="73bfa418-131d-4c11-b8db-3357de780149">
    <MajorUpgrade DowngradeErrorMessage="DowngradeError" />

    <Feature Id="Main">
      <ComponentGroupRef Id="ExampleComponents" />
    </Feature>
  </Package>
</Wix>

Note: change in Folders.wxs to ProgramFiles6432Folder for example all works as expected project build without errors and files structure zipped into .msi

Actual Result

Build project result:

1>D:\Projects\Package1\Package1\ExampleComponents.wxs(4): error WIX0204: ICE38: Component fls4TA3WjWfn7DaNoJE3jCZLKGbPJs installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.
1>D:\Projects\Package1\Package1\ExampleComponents.wxs(4): error WIX0204: ICE38: Component flsbkUUD6Y2rdtC4RnYfRP86W8yvo4 installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.
1>D:\Projects\Package1\Package1\Folders.wxs(4): error WIX0204: ICE64: The directory INSTALLFOLDER is in the user profile but is not listed in the RemoveFile table.
1>D:\Projects\Package1\Package1\ExampleComponents.wxs(4): error WIX0204: ICE64: The directory dZGD2_IybCp2zKj7aBcB854Yokys is in the user profile but is not listed in the RemoveFile table.
1>D:\Projects\Package1\Package1\ExampleComponents.wxs(4): warning WIX1076: ICE91: The file 'fls4TA3WjWfn7DaNoJE3jCZLKGbPJs' will be installed to the per user directory 'dZGD2_IybCp2zKj7aBcB854Yokys' that doesn't vary based on ALLUSERS value. This file won't be copied to each user's profile even if a per machine installation is desired.
1>D:\Projects\Package1\Package1\ExampleComponents.wxs(4): warning WIX1076: ICE91: The file 'flsbkUUD6Y2rdtC4RnYfRP86W8yvo4' will be installed to the per user directory 'INSTALLFOLDER' that doesn't vary based on ALLUSERS value. This file won't be copied to each user's profile even if a per machine installation is desired.
1>Done building project "Package1.wixproj" -- FAILED.

Expected Result

Project built without error, all folder structure included into .msi

Acknowledgements

bevanweiss commented 3 months ago

You appear to be installing files into the executing users roaming profile (AppDataFolder) whilst using a Machine-Wide installation. This is pretty bad form. Why are you doing this?

This is why the Microsoft installation guides are telling you that you're doing wrong. https://learn.microsoft.com/en-us/windows/win32/msi/appdatafolder https://learn.microsoft.com/en-us/windows/win32/msi/ice38 https://learn.microsoft.com/en-us/windows/win32/msi/ice64 https://learn.microsoft.com/en-us/windows/win32/msi/ice91

Perhaps instead of AppDataFolder you meant to use CommonAppDataFolder (C:\ProgramData) https://learn.microsoft.com/en-us/windows/win32/msi/commonappdatafolder

EvgenPervenenko commented 3 months ago

@bevanweiss hi, thanks for reply, I want install application in user scope, maybe there is a workaround for using AppDataFolder, previously I used Harvest files and want to replace for Files, but there is a problem which I faced

bevanweiss commented 3 months ago

You should read through the Microsoft documentation on the ICE warnings / errors as to why you can't just install to a user folder from a per machine install.

If you do want to install to a user folder, then you should author a PER USER installation. https://wixtoolset.org/docs/v3/xsd/wix/package/

EvgenPervenenko commented 3 months ago

Unfortunately Scope="perUser" does not help, still got the same errors

bevanweiss commented 3 months ago

Unfortunately Scope="perUser" does not help, still got the same errors

https://learn.microsoft.com/en-us/windows/win32/msi/allusers https://learn.microsoft.com/en-us/windows/win32/msi/single-package-authoring

You should close this issue (it's not a WiX bug, it's a failure to author in accordance to Microsoft installer requirements). It should be raised instead in discussions