cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Wokawidget
Level 2

Windows Services and InstallShield 2011 LE

Hi,

I am using VS 2010 with the new MS recommended Install Shield 2011 LE.
Using the old VS deployment porjects I could easily create a windows service installer that registered my service.

I cannot for the life of me find this functionality in the LE version...to top that I've spent 3 days trying to find even a simple example on the web with no luck.

Is this something that only the professional edition will handle?

cheers,

Woka
Labels (1)
0 Kudos
(14) Replies
john_whitley
Level 2

Hi Woka,

I am in exactly the same position. I have previously used the built in VS installers to register and start my Windows Services, and although the functionality is limited, it works and is pretty straightforward.

I called Flexera today to ask the simple question "Does the LE product allow you to install services" and the chap could not or would not answer. What he DID say is that Microsoft plan to ONLY support Installshield in future versions of VS and that I should buy Installshield Professional.

The fact that you have not received a reply to your simple straightforward question in several months, along with Flexera advising me I have to spend £1500 to continue doing what I have been doing in Visual Studio for years leads me to believe that lobbying Microsoft to not drop their own installer, or force Flexera to provide a straight answer to a straight question is the way to go.

One more try.

Flexera, can Installshield LE install, register and start a Windows Service or not? If so, please provide an example.

Thank you.
0 Kudos
Stefan_Krueger
Level 9

As far as I know this functionality is not included in InstallShield LE. However I also can't find it in Visual Studio Setup&Deployment projects. How did you do it in VS?
Stefan Krueger
InstallSite.org
0 Kudos
Christopher_Pai
Level 16

Probably the same way *everybody* does it in VDPROJ:

http://blog.deploymentengineering.com/2006/07/msi-vs-net.html

Assuming IS 2010 LE ( Is there a 2011 LE yet? ) doesn't support authoring ServiceInstall / ServiceControl rows ( I haven't looked ) ... the easiest and best quality thing to do would be to create a merge module using WiX to encapsulate the file as a service and then bring it in as a dependency of your IS 2010 LE project.

In fact, that's a good way to make LE do many things it wasn't designed to do. But if you do any serious work with installs you probably will eventually want Professional edition.
0 Kudos
Stefan_Krueger
Level 9

Assuming IS 2010 LE ( Is there a 2011 LE yet? ) doesn't support authoring ServiceInstall / ServiceControl rows
Correct, it doesn't. (And there's no 2001 release of LE yet.)

Probably the same way *everybody* does it in VDPROJ

Installer Class custom actions can be used in InstallShield LE, so the same method should be possible.

If you want to do the "right thing" and use the Service tables, you need to buy a higher edition of InstallShield.
(If I recall correctly: if your service is a .NET assembly in the GAC you can't use the Service tables but must use a custom action, maybe even after InstallFinalize)
Stefan Krueger
InstallSite.org
0 Kudos
Christopher_Pai
Level 16

I love you Stephen but....

NO NO NO NO NO NO NO NO

Do not use InstallUtil custom actions!!!! It's reinventing the wheel at best and catastrophic at worst. Been there, done that, will never, ever do it again.

I just decribed a work around using merge modules to inject the desired behavior into LE without having to fork out extra money for Pro. Although I do believe Pro is inevitable.
0 Kudos
Christopher_Pai
Level 16

Stefan Krueger wrote:
Installer Class custom actions can be used in InstallShield LE, so the same method should be possible.


I'm looking at LE and I don't see anywhere to wire up an InstallUtil CA. I do see where you can call EXE's so even a simple call to SC.EXE would be better then InstallUtil.
0 Kudos
Stefan_Krueger
Level 9

NO NO NO NO NO NO NO NO

I'm sorry if my previous post was misleading. I don't mean you should do this, I only wanted to mention that it's possible.

You can right-click the file and check "Installer Class". This should cause the assembly’s Install, Commit, Rollback, and Uninstall methods (derived from System.Configuration.Install.Installer) during installation.
Stefan Krueger
InstallSite.org
0 Kudos
hackaway
Level 3

I am using VS 2010 Professional with InstallShield LE.
I have a C# project which will run as a Windows Service.

My plan is to have a self installing service.
I modified my Program.cs as follows:
[CODE]
namespace hackawaysprogram
{
static class Program
{
///
/// The main entry point for the application.
///

public static void Main(string[] args)
{
if (args.Length > 0 && args[0].Equals("/i") || args[0].Equals("/u"))
{
if (args[0] == "/i")
{
System.Configuration.Install.ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
}
else if (args[0] == "/u")
{
System.Configuration.Install.ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
}
return;
}
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new DSmsService()
};
ServiceBase.Run(ServicesToRun);
}
}
}
[/CODE]
I have tested this and it works. It installs or uninstalls the service. No paths etc required.

cmd > hackaways.exe /i
or
cmd > hackaways.exe /u


Now I plan to have a VBScript or JScript executing the /i & /u from the InstallShield LE project. Thing is that all this is new to me and I have never used any of those scripting languages nor have I used any custom actions or such.
Can anyone help?
0 Kudos
hackaway
Level 3

I am using VS 2010 Professional with InstallShield LE.
I have a C# project which will run as a Windows Service.

My plan is to have a self installing service.
I modified my Program.cs as follows:
[CODE]
namespace hackawaysprogram
{
static class Program
{
///
/// The main entry point for the application.
///

public static void Main(string[] args)
{
if (args.Length > 0 && args[0].Equals("/i") || args[0].Equals("/u"))
{
if (args[0] == "/i")
{
System.Configuration.Install.ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
}
else if (args[0] == "/u")
{
System.Configuration.Install.ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
}
return;
}
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new DSmsService()
};
ServiceBase.Run(ServicesToRun);
}
}
}
[/CODE]
I have tested this and it works. It installs or uninstalls the service. No paths etc required.

cmd > hackaways.exe /i
or
cmd > hackaways.exe /u


Now I plan to have a VBScript or JScript executing the /i & /u from the InstallShield LE project. Thing is that all this is new to me and I have never used any of those scripting languages nor have I used any custom actions or such.
Can anyone help?
0 Kudos
hackaway
Level 3

I will have to look into alternative paths. Wix & Merge module is one alternative as previously mentioned.
0 Kudos
Stefan_Krueger
Level 9

You don't need script to run an .exe as a custom action (or is this functionality blocked in the Limited Edition?).
Stefan Krueger
InstallSite.org
0 Kudos
hackaway
Level 3

Stefan Krueger wrote:
You don't need script to run an .exe as a custom action (or is this functionality blocked in the Limited Edition?).

OK, well all this is so new to me that I don't know.
I know that the only scripts I can execute is VBScript or JScript not the InstallScript. Anyways, I solved it using .msm and Wix together with IS2011.
0 Kudos
Christopher_Pai
Level 16

And you don't need an EXE to install a service.

http://blog.deploymentengineering.com/2011/01/augmenting-installshield-using-windows_19.html

Also if I needed to run an EXE in a 2010 LE project, I'd use the WiX QuietExecCA pattern. It eliminates the cmd window popup, logs the output and handles a host of other problems that can occur when calling EXE's.
0 Kudos
hackaway
Level 3

Christopher Painter wrote:
And you don't...

Anyone having questions regarding creating a service then check Christopher's blog post on the subject. Big thanks to Christopher!
0 Kudos