Reputation: 14877
I have a Visual Studio setup with a custom action written in C++. I need to launch a process from a custom action but both Install and Commit actions are run elevated and thus my process runs elevated too. I want the new process to run as a regular user.
I have seen Start exe after msi install but using current user privileges but it seems overly complicated and shows no code. I haven't got the time to experiment with an unknown API.
Are there any easy ways? Can I use VS Setup to define a non-elevated custom action or do something from the elevated custom action?
Upvotes: 2
Views: 693
Reputation: 1192
If you just want to test your code, it wouldn't be hard to update your built msi file with Orca. It'll let you add the dll with your code to the binary table, add a corresponding row to the customaction table, and add the action to a sequence.
If you need this to happen as part of your build process, you could accomplish the same thing with vbscript. The SDK comes with good sample vbscript code for interacting with an msi database, as described here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa372865%28v=vs.85%29.aspx
Upvotes: 2