Reputation: 624
We've created an installer using WiX. In the registry we save it under HKCU (see example). Desktop Icons and everything is installed for the Current User.
<DirectoryRef Id="INSTALLDIR">
<Component Id="CMP_SaveInstallDir" Guid="52e5e617-2c9a-4514-a6b0-055e4adc6a0b">
<RegistryValue Id="MyInstallDirId" KeyPath="yes" Action="write" Root="HKCU" Key="Software\ABC\MyProduct" Name="MyProduct" Value="[INSTALLDIR]" Type="string" />
</Component>
</DirectoryRef>
For upgrades we also use WiX. We try find the registry key and if it is available we install the upgrade. That works well, if the person who installed the full installer installs the upgrade installer.
Now the installer should also be used to pre-install the software on some computers. That means, an Admin user ("Joe Admin") installs the software. Later on a normal user ("Pete User", with the right to install software) should be able to install an upgrade.
But as the full install was done by "Joe Admin", "Pete User" can't upgrade with an upgrade installer as the registry key can't be found in his registry (HKCU of "Pete User").
I think that this scenario isn't unusual and so I hope someone can help me to find a solution.
Thanks in advance!
Upvotes: 1
Views: 225
Reputation: 11878
I think Cosmin is right and you have to use per-machine installation in this case.
After all, if Joe Admin installed the application, then only this user has access to it: the desktop icons, program files and its settings are stored in the admin profile. Therefore Pete User has no access to any components of the application.
So either you make the installation per-machine or allow users to install it (not only upgrade).
Upvotes: 1
Reputation: 21436
Here is an article which may help you: http://setupanddeployment.com/installation-environment/peruser-permachine/
Basically, you are handling the install locations incorrectly. If your installation is per-machine (for all users), it should use only per-machine locations. HKEY_CURRENT_USER is a per-user location and using it in a per-machine installer is a bad practice. Hence your problem.
Upvotes: 2