I am hoping this is an easy one, but I am currently trying to wrap an install for a VSTO Excel add-in, which needs to run in the user context. After spending a ton of time with v4.0.6, I found that the Start-ProcessAsUser module had bugs, and recently started setting it up with the newer dev version, which I believe has resolved some of my issues, and is getting further than ever before.
VSTO (Visual Studio Tools for Office Solution Installer) seems to be a bit of a pain in the butt, but with the new version, I am at least getting a bit closer to getting this to work. My install command is:
Not a massive fan of clickonce installers but from I gathered in the past, /install “directory to file” /silent worked but, the certificate for the app needs to be expoted as well with the below ran as like a pre-req
Unfortunately (or fortunately), I am at least past this point. I have the cert already installed and verified that it was in the TrustedPublisher store, and even have a post uninstall step that works to remove the correct cert.
Right now, it seems to just be that it actually opens the VSTOInstaller.exe, but nothing is being passed for parameters. If I run through it as just a Powershell script and run it under a standard (non-admin) user, it works fine, but when I try to push through Intune in the user context, it bombs out:
I tried even running a script to try to set it up as a scheduled task for the user, but that fails to do anything. PSADT and the newest build with Start-ProcessAsUser is the closest I have gotten where it is at least getting far enough to trigger VSTOInstaller.exe, but doesn’t seem to be getting the parameters passed over to install.
Experience tells me (that in some circumstances) if variables when expanded have spaces in them, may not get parsed correctly, putting the variable within $() usually fixes this isse
This is much like the way you have this line:
That last example was just one of the standalone Powershell scripts that I have tried putting through Intune, separate from PSADT. I just tried it again with your suggestion and it still fails to install. Really, PSADT so far is the only one that is able to get far enough to bring up the VSTOInstaller.exe error box, so it is definitely beating out the Powershell scripts being packaged and run in the user context.
It just seems that for some reason, this doesn’t seem to be passing parameters over.
Really, I am tempted to install it manually, but now I feel like it is nearly there and I have spent enough time messing with it that my stubborn â– â– â– wants to see it through haha
Yeah, I absolutely hate these things. I do have the cert installed in the TrustedPublisher store by using a separate Win32 app that runs in the System context.
This happens to be the first time I have tried this Start-ADTProcessAsUser and hardly ever install in the User context in Intune, so it’s all a little foreign to me. It’s at least getting far enough to get to the VSTOInstaller, but it is almost like it is just not passing the ArgumentList parameters over and bombing out at that point.
Other than that, why use Start-ADTProcessAsUser at all? Just make Intune deploy the app in the user’s context and run it that way. Smarter, not harder.
I’ve tried a little bit of everything. At first, I was only trying to run it with Start-ADTProcess and tried it in the user and system context and had no luck. That might have been due to the cert needing installed, so I split it up into two packages. One in the System context to install the certs, then the second in the User context to just install the software.
I think I should have written down each of the attempts and the Intune settings, but I just followed your advice, and just by switching back to Start-ADTProcess and running in the user context, all was better. Definitely smarter, not harder haha