0
votes

Please give your ideas:

In a solution file ,I am having two projects PROJECTA and SETUP project. After creating the installer of PROJECTA , the installer "example.msi" contains PROJECTA.exe ( or active output ) of the PROJECTA .

While installing "example.msi", i want to run the PROJECTA.exe in the background.

I tried custom control and also installer class

If the path of the exe was given ( as shown below) , it works fine. but this is not the intended behaviour , i want PROJECTA.exe which is in example.msi to be copied to that location before installation , so that i can run from there during installation.

How this can be achieved .

C# Syntax :

[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]

    public override void Install(IDictionary stateSaver)
    {
        base.Install(stateSaver);
    }

    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
    public override void Commit(IDictionary savedState)
    {
        base.Commit(savedState);
        string s="C:\\xxx\\PROJECTA.exe";
        System.Diagnostics.Process.Start(s);

    }

Thank you in advance.

1
This doesn't make sense and it's also not a recommended approach. If you need some functionality from your application, the correct approach is to move that functionality in a custom action (EXE or DLL). This way the custom action is used during install and performs only the installation actions and your application is installed on the target machine and it's used as an application. - rmrrm

1 Answers

0
votes

Make PROJECTA.exe a MSI install, then add it to your binary table. Then create a CustomAction of type 50 if it's going to be done in the UI sequence, or type 7 if it's going to be in the exec sequence. You can't do it in a .NET CA as you're only allowed to have 1 instance of a MSI installer running at a time. By running a nested installer you are basically sharing the same MSI installer engine instance

After saying all this, nested installers can be painful, and should be avoided if you can help it.