Per-Machine install problem with User Profile

4.2k views Asked by At

When building my WXS data into an MSI I get the following error:

ICE38: Component CreateFolder installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.

This is confusing me cause I have my project set to be a per-machine installation, so from my understanding it should install to the "C:\Users\All Users" or "C:\Users\Default" not to the actual user profile. I have tried a couple of different methods to say it is a per-machine installation, but none of them work. Any thoughts would be greatly appreciated. I am stumped!

To make it an per-machine I tried these two settings (separately) and neither one worked.

<Property Id="ALLUSERS" Value="2" />

and

<Package InstallScope="perMachine" ... />

EDIT: Code for CreateFolder

            <Directory Id="AdminToolsFolder" SourceName="Admin Tools">
                <Component Id="CreateFolder" Guid="{452A617E-XXXX-XXXX-XXXX-3710802B3BBD}" KeyPath="yes">
                    <CreateFolder Directory="AdminToolsFolder" />
                </Component>
            </Directory>
2

There are 2 answers

2
Rob Mensching On BEST ANSWER
4
Dirk Vollmar On

If you want to create a shortcut you can use the Shortcut element:

<Directory Id="AdminToolsFolder" SourceName="Admin Tools">
  <Component Id="MyShortcuts" Guid="<guid value>">
    <Shortcut Id="Shortcut_MyAdminTool" Directory="AdminToolsFolder"
              Name="My Admin Tool" Target="[#AdminTool]"
              Show="normal" WorkingDirectory="TARGETDIR" />
  </Component>
</Directory>