locked
msi custom action with user permissions RRS feed

  • Question

  • I created an installer with visual studio web deployment project. At the end of installation procedure I want to run my application (exe file). I had two problems with that: first that the installer would wait for an exe to finish execution (which is not what I wanted, so I used a wrapper vbs) and second that the vbs is run with SYSTEM account context which causes some permission problems later on. Is there any way to make this custom action script run as the user who executed the installer? i can change it either with VS or Orca. Thanks in advance,
    Wednesday, December 17, 2008 12:06 PM

Answers

  •  This is a change for VS 2008 to run with SYSTEM so that installs work on UAC systems. If you want to run the MSI on Vista you will require use of an elevation prompt of some kind before your custom action will work. Always using setup.exe should work, but just running the MSI won't unless you start from an elevated environment.

    You'd need to go to the CustomAction table and turn off the msidbCustomActionTypeNoImpersonate bit:

    http://msdn.microsoft.com/en-us/library/aa368069(VS.85).aspx

    The best overall thing to do is to do this is not launch your exe. Just let the user (whatever account that is) run it later. One of the issues is that if a non-privileged user wants to install your app then an administrator can start it with the elevation prompt for credentials and then walk away. However at the end of the install that non-privileged user is left with an application running as administrator, so the non-privileged user can then do things that they're are not allowed to do.
    Phil Wilson
    • Marked as answer by Steven.Yu Tuesday, December 23, 2008 1:31 AM
    Thursday, December 18, 2008 1:25 AM
  • Hi TomaszGrobelny,

    Here's a detailed explaination of launching your application after install.
    The main point is to handle the Committed event.
    http://www.codeproject.com/KB/install/Installation.aspx
    Wish this could help you.

    If there is any problem, please feel free to let me know.

    Best regards,
    Steven Yu
    • Marked as answer by Steven.Yu Tuesday, December 23, 2008 1:31 AM
    Thursday, December 18, 2008 7:22 AM

All replies

  •  This is a change for VS 2008 to run with SYSTEM so that installs work on UAC systems. If you want to run the MSI on Vista you will require use of an elevation prompt of some kind before your custom action will work. Always using setup.exe should work, but just running the MSI won't unless you start from an elevated environment.

    You'd need to go to the CustomAction table and turn off the msidbCustomActionTypeNoImpersonate bit:

    http://msdn.microsoft.com/en-us/library/aa368069(VS.85).aspx

    The best overall thing to do is to do this is not launch your exe. Just let the user (whatever account that is) run it later. One of the issues is that if a non-privileged user wants to install your app then an administrator can start it with the elevation prompt for credentials and then walk away. However at the end of the install that non-privileged user is left with an application running as administrator, so the non-privileged user can then do things that they're are not allowed to do.
    Phil Wilson
    • Marked as answer by Steven.Yu Tuesday, December 23, 2008 1:31 AM
    Thursday, December 18, 2008 1:25 AM
  • Hi TomaszGrobelny,

    Here's a detailed explaination of launching your application after install.
    The main point is to handle the Committed event.
    http://www.codeproject.com/KB/install/Installation.aspx
    Wish this could help you.

    If there is any problem, please feel free to let me know.

    Best regards,
    Steven Yu
    • Marked as answer by Steven.Yu Tuesday, December 23, 2008 1:31 AM
    Thursday, December 18, 2008 7:22 AM