Install user app that requires admin rights?

I am trying to install an app (Arduino Create Agent) which installs under the user’s %APPDATA% folder. But the installer needs admin rights.

As I’ve always done in the past, prior to uploading this to Intune, I always run the Deploy-Application.exe as Administrator to test how the install goes and check for issues.

With this particular app, I can see that the files get written to %APPDATA% and that the agent is installed and running in the taskbar so it looks like the install completed. I even tried running the installer with the same parameters in an admin command prompt and I do get an exit code of 0. And yet the PSADT window that indicates the installation progress is still running and showing that the install is in progress as if it never detected the installer’s exit code. Could it be because the installer is a small one and completes very quickly (as soon as you execute it, it immediately exits successfully) that PSADT is not able to capture the exit code? Or is it something else?

I am using Execute-Process -Path “ArduinoCreateAgent-1.2.7-windows-amd64-installer-chrome.exe” -Parameters ‘–mode unattended’

Also, since this installer writes to the user’s %APPDATA%, should I be installing this under USER context instead of SYSTEM and using Execute-ProcessAsUser instead?

NOTE: the uninstaller is also written to %APPDATA% and not %PROGRAMFILES%

I’m assuming the following:
-Your users are not admins on their computers
-you are delivering the app via something like SCCM or Intune
-The application does not need admin to run after installation

The real issue is the horrible installer. It requires admin but only installs in a user’s profile. The only reason it truly needs admin is to install files in C:\Program Files\ or C:\Windows. The OEM packager didn’t think to split the package.

You have three ways to deal with this:
1-Redo the installer to either install to Program Files or split the package in two: user profile changes and changes that requires an admin account
2-make the target user an admin temporarily during install and then make them user after (manually or by scripting)
3-create a session with user environment variables pointing to the current user but run the installer as system.

The safest is option 2.
If you want to script it, it will be tricky. If you want to proceed I can explain more of how I would proceed and tell you what to watch out for.

Sorry for the late reply. The requestor backed down and decided to use another package instead so we did not pursue this any further. But thanks for the suggestions!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.