Install msi as user

I’m trying to install an msi as a user with the following line.

Execute-ProcessAsUser -Username ‘$currentUser’ -Path ‘msiexec.exe’ -Parameters “/I $dirFiles\mango.msi”

I’m receiving an error about setting permissions on RunHidden.vbs and
PSAppDeployToolkit-ExecuteAsUser-001.xml

Also about creating a scheduled task by importing the xml. Any ideas?

Thanks

That current User got Admin Rights?

The other possibility is which version of the Toolkit are you using?
v3.10.1 is the latest [correction] v3.10.2 is the latest (released 13th August 2024), the previous version contained a fix for an issue with Runhidden.vbs, see previous discussion:

I tried with users that do and do not have admin rights.

I am using 3.10.2 downloaded yesterday.

is this a self created MSI or vendor based?
Are you able to install this MSI as a standard user manually or do you get any UAC prompts? in that case the UAC compatiblity settings in the MSI are set, you can try setting the ‘DisableUAP=1’ property als make sure the ALLUSERS property is empty

This is a vendor created MSI. Yes, it does install as a standard user because it installs to the user’s appdata folder. That is actually why I am trying to run the process as the user, because the install works with a normal script in SCCM but it installs the to root of the C drive which is less than ideal.

I tried setting the install path with msi parameters, but none seemed to work. The vendor hasn’t been very helpful unfortunately.

Why not use INSTALLDIR=<Path> to tell the MSI where to install it?

So let me get ir right.
If you install the app as usr manualy it works, no errors, etc.
if you install it from sccm, user based you get the error above ‘runhidden.vbs’ and it installs to the root of the C drive?

What app is it, is it something i can download a trial version? so i can take a look at it?

Sorry I didn’t post an update. I went back to the parameter option without the toolkit and got it to work via SCCM with TARGETDIR.

I was getting the vbs error while using the toolkit in and out of SCCM. (with no install success)
Installing via SCCM without the toolkit installed to the root of C. (assuming because it uses the system account to install)

This was my first attempt at using the toolkit, so perhaps I was missing an element of using it properly.

I will go with the normal script install for now, but thank you for all the replies and suggestions!

If you have an MSI that installs in user context, you should really deploy the entire installation in user context instead of having PSADT run as system then try to trigger it in user context as a scheduled task. Note you will need to modify the XML config to allow the toolkit to run without admin rights. Then you can just use the standard Execute-Msi command.

There may yet be a bug here however, since you should not be getting a permissions error doing what you are trying to do.

1 Like

I usually just create a batch-file and invoke that with Execute-ProcessAsUser.
The batch-file can be as simple as this:

"C:\Windows\System32\msiexec.exe" /I "%~dp0mango.msi" /QN /NORESTART /LOG "%TEMP%\mango_Install.log"