cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
FighterZP
Level 3

installshield 2009 automation - Add NT Service

How can I add NT Service to my component using vbs or C#?
I need example. Please help

My sample code (C#):
ISWiAuto15.ISWiProject project = new ISWiAuto15.ISWiProject();
project.CreateProject("c:\\ism\\test07.ism", ISWiAuto15.ISWiProjectType.eptMsi);

project.OpenProject("c:\\ism\\test07.ism",false);
project.ProductCode = project.GenerateGUID();
project.ProductVersion = "1.0";
project.ProductName = "Name 123";

ISWiAuto15.ISWiComponent component;
component = project.AddComponent("Component123");
component.AddFile("c:\\tftp.exe");
project.AddFeature("MyFeature123").AttachComponent(component);

project.SaveProject();
project.CloseProject();
Labels (1)
0 Kudos
(4) Replies
hidenori
Level 17

InstallShield automation interface currently does not support adding NT services to your projects. I filed the work order #IOA-000057629 so that we will take into cosideration for a future release.

If your .ism project file is stored in Binary format, you can write to the ISM tables (ServiceControl and ServiceInstall) directly using Windows Installer Automation, as described in this old DevLetter tip: Using MSI Automation to Modify a Developer 7 Project.
0 Kudos
Christopher_Pai
Level 16

Time and time again I discover that there are countless items that the automation interface doesn't do. Do you think you could write a ticket that generically covers them all?

I.e. there shouldn't be a single control and I can click on the IDE that I can't also programatically update. The UI shouldn't have any access to the datalayer without going through the same business layer that is exposed to the automation interface.

My guess is there is only about 80% coverage for the automation interface.
0 Kudos
FighterZP
Level 3

Can I modify ISM Tables (in Direct Editor) using ISWiAuto15?

I have error while open ISM file in DirectMode using Windows Installer Automation.

Type installerType = Type.GetTypeFromProgID("WindowsInstaller.Installer");
Installer installer = (Installer)Activator.CreateInstance(installerType);
Database database = installer.OpenDatabase("c:\\ism\\test04.ism", MsiOpenDatabaseMode.msiOpenDatabaseModeDirect);

But in ReadOnly mode I successfully open ISM file
Database database = installer.OpenDatabase("c:\\ism\\test04.ism", MsiOpenDatabaseMode.msiOpenDatabaseModeReadOnly);
0 Kudos
Christopher_Pai
Level 16

What I always do in my build automation is use the Auto for everything I can and then call into the project property that allows me to switch the format from XML to Binary. You do check it into source control as xml, right? 🙂

Once it's in Binary format I use WiX DTF as my MSI interop library of choice. Microsoft.Deployment.WindowsInstaller is a wrapper for the win32 P/Invoke ( much better then COM interop ) and comes complete with support for IDispose via using(){} blocks. Search my blog for DTF for examples ... you will love it.
0 Kudos