0

I'm using a setup project, I've created an installer class:

using System;
using System.ComponentModel;
using System.Runtime.Remoting.Contexts;

namespace Client.Common
{
    [RunInstaller(true)]
    public class Installer : System.Configuration.Install.Installer
    {
        public Installer()
        {

        }

        public override void Commit(System.Collections.IDictionary savedState)
        {
            try
            {
                base.Commit(savedState);



                System.Diagnostics.Process.Start(Context.Parameters["TARGETDIR"] + "Client.UI.exe");

                base.Dispose();
            }
            catch (Exception ex)
            {

            }
        }
    }
}

And I am setting CustomActionData of my commit custom action to:

/TARGETDIR="[TARGETDIR]\"

This works fine when I run the MSI to install for "Just Me", it opens up the exe, but when I install for "Everyone" it does not run the exe.

Am I missing something to enable this to happen for "Everyone" as well?

John
  • 263
  • 1
  • 15

1 Answers1

0

When you install this as Just me, the custom actions run with the credentials of the installing user, who is the current interactive logged on user, so that's just like running the app from explorer or a shortcut.

When you run the custom action in an Everyone install it runs with the credentials of the local system account. This can result in any number of potential issues or crashes. For example, the system account is not allowed to show UI to the interactive user's desktop for security reasons; if you try to access user profile locations (desktop, user's data folder etc) you might crash because the system account doesn't have these; the system account has no network privileges so using the network will cause issues. Without knowing exactly what your code tries to do there's no way to say which of these could be the issue.

PhilDW
  • 20,260
  • 1
  • 18
  • 28