Using RunAs to Install and Run Apps: Gotcha
I'm beginning to dig into the mysteries of how the Microsoft Installer elevates privileges for package installation. I'll be reporting a lot more about that particular quagmire in the coming weeks, but I wanted to report one gotcha to watch out for.
Some packages run just fine when you are a member of the User account but run them with RunAs under an Admin privileges (many don't). And many well-designed packages have a closing screen that helpfully reports that the app was successfully installed and gives you the option to do various things, such as view the ReadMe or run the app when you click Finish.
Be careful of the latter! I just installed an app, ran it right away, and spent some time configuring it for my use. But then I noticed that the program saved data in the Administrator's Documents and Settings areas, not my user area. Well, duh, Don! The installation was run as admin, the new app's process was spawned from there, so of course it is in the Administrator's data area. Which means that the next time I start the app as a lowly user all of my data and configuration I set up weren't available to me.
I don't yet know if this behavior is required by MSI, if there is a way around it, or even if there is a way for the package to know it is being RunAs. As soon as I know, I'll blog that. In the meantime, don't start the installed app from the installation program!