How to fix ICE57.Per-User installation

后端 未结 2 783
既然无缘
既然无缘 2021-01-18 12:56

Our application writes some settings to the registry into the HKCU hive during runtime. I want to delete this settings during uninstall. Here is code:

  <         


        
相关标签:
2条回答
  • 2021-01-18 13:15

    I've got an answer on wix-users mailing list. Here is Peter Shirtcliffe's answer:

    ProgramFiles is a per-machine location. You can only access it when elevated. If you want to install program code in a per-user installation, you should install to %LocalAppData%\Programs.

    Remove the condition entirely. The component will be installed but will have no effect until you uninstall the application. At that point, when the component is removed, the registrykey will be removed also.

    0 讨论(0)
  • 2021-01-18 13:35

    You are operating on the HKCU hive which is only available to the current user.

    MSDN states:

    ICE57 validates that individual components do not mix per-machine and per-user data. This ICE custom action checks registry entries, files, directory key paths, and non-advertised shortcuts. Mixing per-user and per-machine data in the same component could result in only partial installation of the component for some users in a multi-user environment.

    The ICEs are validations on your installation package. As stated above, ICE57 is to make sure you don't mix up per-machine and per-user constructs. If you must remove entries to HKCU during uninstall (and the software is installed per-machine) then you can turn off that specific validation in Visual Studio in Properties > Tool Settings as shown in the screenshot below:

    enter image description here

    However, you may want to think about the root cause of your issue. If you are doing a per-machine install, your installer or application should probably not be writing to HKCU as it is only available to the current user, whereas your app is installed for all users.

    0 讨论(0)
提交回复
热议问题