AnsweredAssumed Answered

How to deploy a custom component using a setup project in Visual Studio 2013

Question asked by Barbara_Schneider on Jan 25, 2016

For deploying a custom component using a setup project in Visual Studio 2010, I used the following guideline:

ArcObjects Help for .NET developers

 

In Visual Studio 2013, however, this kind of setup project is not supported any more. Instead, InstallShield has to be installed, which works like a plugin in Visual Studio. I did the following steps to create a setup:

  • First of all, InstallShield Express, Premier, or Professional is needed. InstallShield Free Edition is not sufficient. Reason: When unistalling, a custom action can only be invoked after system changes. However, we need this action before the installed dlls are removed (more to custom actions see below).
  • Create a new project that will be an executable. This executable is used to invoke ESRIRegAsm.exe (see also link above). I didn't figure out how InvokeESRIRegAsm.dll could do that so I created an executable. I altered the code from project InvokeESRIRegAsm (see link above). Important: the following lines of code must be used before the process is started:
    ProcessStartInfo.UseShellExecute = true;
    ProcessStartInfo.Verb = "runas";
  • Create a new Setup Project and go through the Project Assistant to add files (and so on)
  • Define a custom action for during Installation (after file transfer) and add the executable created above. Please note: if a path in the Command Line contains blanks, it has to be enclosed in quotation marks.
  • Define a custom action for during Unistallation (before system changes) and add the executable created above.

 

Does anyone have a better solution? If yes, please let me know.

Outcomes