Reputation: 1009
I need my app to be installed to local app data of the active console session, or even to all the machine's users.
But when deploying via GPO, a system session is the one running the MSI.
So how can I create an MSI via WiX Toolset that achieves that purpose?
I tried using this guide: https://learn.microsoft.com/en-us/windows/win32/msi/msiinstallperuser
So I set these properties in the wxs file:
<Property Id='ALLUSERS' Value='2' />
<Property Id='MSIINSTALLPERUSER' Value='1' />
And the dir structure is:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder">
<Directory Id="APPLICATIONFOLDER" Name="MyApp">
Then, I ran the msi via system session using psexec, but as the log says:
PROPERTY CHANGE: Adding APPLICATIONFOLDER property. Its value is 'C:\WINDOWS\SysWOW64\config\systemprofile\AppData\Local\MyApp\'.
And it tries to install to the default local app data
I've tried several other methods, like changing the APPLICATIONFOLDER via a c# custom action, or by modifying the database via c# custom action, but I still didn't find a working solution.
Any help will be greatly appreciated
Upvotes: 0
Views: 1105
Reputation: 376
What you did to the MSI was correct. But, you used psexec to "install" (instead of GPO) and as you stated, "via system session", so you got the system account's local app data directory.
You need to assign (or maybe publish, but you were describing assign) your MSI to your users in GPO. Then the MSI will be installed as you desire. If you assign to the computer in GPO, the MSI should be setup to be "per-machine", in which case ProgramFiles would be the better directory to use (and ALLUSERS should be "1" in that case).
Use Group Policy to remotely install software
Upvotes: 1