Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Can run CustomAction under user account
 

Can run CustomAction under user account

I am using VS2008 to build my setup program (.MSI). One thing I noticed is that the setup exe is running under user account, while the custom action starts my app.exe using Process.Start() and app.exe is running under System account. This create a problem for app.exe to run under system account. We require it to run under user account. I have been search the appoach for a while with no luck. The only way I found is to edit the MSI file directly using Orca after the project build. We can't take that approach since we build out project on daily basis.

Is there any way to specify the CustomAction to run under User Account before we build the deployment project?

Thanks!
Zongwen
Zongwen  Monday, August 03, 2009 4:05 PM
No, only after it's built.
If you search this forum for wirunsql you'll see some comments about post-build steps you can run. These can update the MSI file after the build if you can find your custom action type in the CustomAction table and turn off the msidbCustomActionTypeNoImpersonate bit. That will incorporate an automatic update into your build.
Phil Wilson
  • Marked As Answer byZongwen Thursday, August 06, 2009 1:35 PM
  •  
PhilWilson  Monday, August 03, 2009 8:06 PM
Hello Zongwen,

Apart from Phil's suggestion, you might also try with the Windows Installer XML (WiX), which is a toolset that builds Windows installation packages from XML source code. It also can be build with Visual Studio(in fact MSBuild).

http://wix.sourceforge.net/index.html

Please take a look at the Impersonate attribute on the following page:
http://wix.sourceforge.net/manual-wix2/wix_xsd_customaction.htm

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Marked As Answer byZongwen Thursday, August 06, 2009 1:35 PM
  •  
Rong-Chun Zhang  Tuesday, August 04, 2009 10:29 AM
No, only after it's built.
If you search this forum for wirunsql you'll see some comments about post-build steps you can run. These can update the MSI file after the build if you can find your custom action type in the CustomAction table and turn off the msidbCustomActionTypeNoImpersonate bit. That will incorporate an automatic update into your build.
Phil Wilson
  • Marked As Answer byZongwen Thursday, August 06, 2009 1:35 PM
  •  
PhilWilson  Monday, August 03, 2009 8:06 PM
Hello Zongwen,

Apart from Phil's suggestion, you might also try with the Windows Installer XML (WiX), which is a toolset that builds Windows installation packages from XML source code. It also can be build with Visual Studio(in fact MSBuild).

http://wix.sourceforge.net/index.html

Please take a look at the Impersonate attribute on the following page:
http://wix.sourceforge.net/manual-wix2/wix_xsd_customaction.htm

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Marked As Answer byZongwen Thursday, August 06, 2009 1:35 PM
  •  
Rong-Chun Zhang  Tuesday, August 04, 2009 10:29 AM
Hello Zongwen,

I am writing to check the status of the issue on your side. Would you mind letting me know the result of the suggestions? If you have any additional question, welcome to post here.

Have a great day!

Thanks,
Rong-Chun Zhang
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Thursday, August 06, 2009 8:52 AM
Hi Rong-Chun,

Phil's suggestion works. What I have done is to add the command in PostBuildEvent of the setup project to run WiRunSQL.vbs with my update SQL statement. The SQL statement simply updates the Type property of the CustomAction table. The MSI file has been successfully updated.

I didn't try to Wix since by that way we have to reconstruct the setup project. I assume Wix approach will involve more work than the vb script approach.

Thanks for your help!

Zongwen
Zongwen  Thursday, August 06, 2009 1:43 PM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce falied to copy setup.exe - already exists
• Installer cutom action?
• Build failure when no local admin rights
• Add sattelite assemblies from third party components
• Passing CustomActionData as arguments to Custom Action MFC Exe
• Sequential installs
• Having a problem installing a service with Vista?
• Installing Windows Service with my main project
• Seperate Clickonce Forum?
• Notification on Downloding .MSI before start installing application using SETUP.EXE