How do I create an InstallShield LE project to install a windows service?

97,419

Solution 1

For Visual Studio 2012 & InstallShield LE, do the following:

  • Run through the InstallShield project assistant and add the primary output of your service to the Application files section.
  • After you are done with the project assistant, double click the "Files" item under step two of the setup project.

Files section

  • Right click on the primary output of your service, and go to properties.
  • Click the "COM and .NET Settings" tab, and place a check in the "Installer Class" checkbox. enter image description here
  • Click Ok

Now, once you build and run your install, your service will show up in the Windows Services snap in.

Note that this assumes you added a "Project Installer" to your service project (Right click on the service design sheet and click "add installer"). I can confirm this work on Windows 8 with Visual Studio 2012 / InstallShield LE.

Solution 2

I've recently installed VS 2012 with Install Shield LE. At first I kept getting a ISEXP -5036 internal server error after a build (this was after setting up a ISLE project and running through the Install Shield Project Assistant). Eventually I found out that it was trying to create the MSI in the DVD-5 media type which is where it was failing. For some reason, creating the solution again from scratch somehow recognizes to only build to the CD_ROM and SingleImage media types which works.

Anyway to rectify the 5036 error, click the Build tab in VS 2012 (top menu), select configuration manager and you should see that your IS setup file is selected on the DVD-5 configuration. Change this to CD_ROM and click close. Once you build/rebuild it will complete with no IS 5036 error.

enter image description here

Solution 3

While using the installer class checkbox may work for some instances, you may experience the following error:

Error 1001.The specified service already exists

Here is an excerpt from this link on how to resolve this issue:

For Error: Error 1001.The specified service already exists

This error will occur if the component installing a .NET Service is incorrectly configured with ".NET Installer Class" set to Yes. The method to install a .NET Service is to use Component\Advanced Settings\Services view, not the ".NET Installer Class" setting. Making definitions in the Component\Advanced Settings\Services view creates entries in the Windows Installer ServiceControl and ServiceInstall Tables. These entries are used by the Windows Installer "InstallServices" action to install the Service.

Solution 4

If your project is .NET, then try then you can use the ServiceProcessInstaller class with InstallShield LE.

To get it to work with InstallShield, you have to go into the InstallShield "files" tree and right click on your file. Then check the checkbox for "Installer class" on the "COM and .NET settings" tab.

I have gotten it to work, but I've had problems on some OS's like Windows 2008R2. Your mileage may vary.

Here is an example: http://www.codeproject.com/Articles/14353/Creating-a-Basic-Windows-Service-in-C

Solution 5

I had all sorts of problems with this.

As follows.

  1. InstallShield takes ages to download
  2. the registration process is a pain.
  3. the configuration options are confusing and overly complex.
  4. the accepted solution on this thread is a hack and it doesn't always work - see 1001 in the documentation - essentially you need to get through the paywall to get the right configuration options to install a windows service.

Solution for me as mentioned elsewhere - was to abandon InstallShield

enter image description here

Very easy from that point.

Edit: Update - install the latest version from here https://wix.codeplex.com/releases/view/115492 for vs 2013 / 2015

Share:
97,419

Related videos on Youtube

fizch
Author by

fizch

Updated on December 20, 2020

Comments

  • fizch
    fizch over 3 years

    I downloaded Visual Studio 2012 yesterday when it was released on MSDN. I have noticed that a few of the project types that we had in 2010 are gone or different. The biggest difference for me right now is the removal of the Windows Installer project. Now we are being forced to use the InstallShield LE (Limited Edition). The problem here is that I write a ton of Windows Services and I can't see how to setup InstallShield LE. It appears that we (my company) will have to invest in licenses for the professional edition.

    Has anyone found a way to install services in InstallShield LE? When using the Windows Installer project, you just set the custom actions.

    • Christopher Painter
      Christopher Painter almost 12 years
      Using InstallUtil custom actions in Visual Studio Deployment projects was actually a really poor practice. It's basically reinventing the wheel with a fragile solution because the underlying authoring tool didn't expose MSI's native capabilities.
  • fizch
    fizch over 11 years
    Another technology to learn? Up until yesterday, I had not heard of WIX. I still do not know anything about it. It sounds like this whole process is becoming increasingly difficult for something that used to take just a few clicks.
  • Christopher Painter
    Christopher Painter over 11 years
    It only takes a few clicks to RUN an installer. Authoring them has always been far more effort.
  • fizch
    fizch over 11 years
    It also only took a few clicks to setup the installer. You have to type the title, the manufacturer, and etc, but you did not have to author an entire xml document. What can you tell me about WIX? I can tell that you obviously know a lot about it. What is it? Where do I get it? How do I use it? Etc...
  • Christopher Painter
    Christopher Painter over 11 years
    I've been writing installers for 16 years and only simple installs with a single EXE and shortcut take me 'just a few clicks' to author. Eitherway you can find WiX on CodePlex and there is a book published on the subject. The underlying technology is Windows Installer and that documentation can be found in the Platform SDK and on MSDN.
  • JimSTAT
    JimSTAT over 11 years
    Seriously"there is a book published on the subject...docs on in the SDK".?? Chris, we're just trying to migrate our 2010 solutions to 2012 and install/setup is stopping us in our tracks. MS, bring back VS Setup/Installer visualstudio.uservoice.com/forums/121579-visual-studio/…
  • fizch
    fizch over 11 years
    Ok, this also works in VS 2010 and Win 7 Pro. I have yet to try it in VS 2012, but this should do it. Thanks.
  • fizch
    fizch over 11 years
    Sorry. I did not see this until today. It looks like it is pretty much the same answer as the one I accepted. I'll +1 it.
  • pithhelmet
    pithhelmet about 11 years
    could you help and explain this.... Component\Advanced Settings\Services" view can be found??
  • David
    David about 11 years
    This may not have anything to do with his problem, but it solved mine. Thankyou! +1
  • adelb
    adelb about 11 years
    Is it possible to have a dialog asking the user for the database connection string (Server, authentication and database name) and update the windows service configuration file using InstallShield LE?
  • Paul Hutchinson
    Paul Hutchinson almost 11 years
    it's in the premier edition of the installer (ffs! microsoft why did you take out setup project type!).. If you have the premier edition. community.flexerasoftware.com/…
  • Jonty
    Jonty almost 11 years
    I found that it's related to the length of the setup project name i.e. change your setup project name to something shorter like "Install" or "Setup".
  • Jonty
    Jonty almost 11 years
    This is a pretty good guide: c-sharpcorner.com/uploadfile/cb88b2/….
  • soclose
    soclose over 10 years
    1+ Mongo - it works on VS 2012 / InstallShield LE and Win 7 64 bit
  • Kiquenet
    Kiquenet almost 10 years
  • Nick Bork
    Nick Bork almost 10 years
    Same issue for me right off the start, default install had DVD-5 as the configuration and the setup failed to build. With your tip I changed it to Single Image and built without issue!
  • beaumondo
    beaumondo over 9 years
    DVD-5 was selected. Simple but great answer
  • Dave
    Dave over 9 years
    Great summary! I did have trouble with the step 'add the primary output of your service'. I simply selected the executable for the service and it worked. Now "MyService.exe" is in the Start Menu where it does not need to be -- so I need to get rid of that and everything will be fine.
  • Rajeev
    Rajeev about 9 years
    This option does not start the service after installation. To install service and start it, in solution explorer, select 3. Configure Target System > Services.
  • Mitulát báti
    Mitulát báti about 9 years
    It doesn't work for me. A message box says Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with ServerExplorer, Windows Services Administrative tool or the NET START command.
  • Justin Emlay
    Justin Emlay over 7 years
    Perfect, thanks! I can confirm this work with Visual Studio 2015.