We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

BMKyle
Posts: 4
Joined: Wed Nov 12, 2014 5:09 pm

Service Instance Installer [Help!]

Hi there,

I am currently working with Advanced Installer 11.3 and am trying to create an installer which can be invoked via command line. (Trying to set installer properties via passed parameter values)

The installer is to create an instance of a windows service with a specified service name and display name, this installer would be invoked as many times as needed with different parameter values to create separate instances of the project for each install. Hopefully something like the line below:

Code: Select all

MyInstaller.exe InstanceName=MYSERVICE_INSTANCE_1 ServiceName=MyService1 DisplayName=MYSERVICE_1 ServiceAddress=192.168.1.254 ServicePort=8085
I would like to extract the ServiceName and DisplayName and install the specified service file with these passed values.

I would also like to create an XML fileand manipulate some element text for ServiceAddress and ServicePort. (All works fine now for my Full-UI project, just need a way of setting these via cmdline)

I had attempted to do it via the .NET Installer Class action specifying the config file which I would modify during install but It appears I cannot select a file which is modified at install time.
If I could get some clarification on how I could achieve this that would be much appreciated.

Kyle
BMKyle
Posts: 4
Joined: Wed Nov 12, 2014 5:09 pm

Re: Service Instance Installer [Help!]

I am at the point where I can create multiple instances via command line - EXCEPT for the service installation, my Service is installed with Service name: [|SERVICE_NAME] and Display Name: [SERVICE_NAME]. I understand the pipe means at build time, Is there any way this can be changed? This seems to me to be the only important part of installing services

My instances install correctly into the correct folders; my xml updates perfectly yet my service is being overwritten with each instance installation. The service instance is the purpose of the installer, If I could get some help on why this isnt working that would be great.

My command line parameter as of now:

Code: Select all

 setup.exe INSTANCE_ID="INSTANCE_001" DATABASE_NAME="TESTDB" DATABASE_SERVER="192.168.1.254" SERVICE_ADDRESS="localhost" SERVICE_NAME="SERVICE_1" SERVICE_PORT="8085"
Once this is working I hope to be able to install instances via command line Silently without any user input whatsoever.

Thanks, Kyle.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service Instance Installer [Help!]

Hello Kyle and welcome to Advanced Installer forums,

First of all I apologize for my delayed reply.

From what I understand you are using a .NET Installer Class action to install your service and you want to be able to set some installer properties. Then you want to pass your installer properties to your NET custom action and to use them to update an XML file.

In order to achieve this you should first use public properties (having names including only upper case letters, e.g. SERVICE_NAME), because the private property values are reset when are passed from Wizard Dialogs Stage to Install Execution Stage.
Then, to create and edit an XML file you can use our "XML Edit" feature. Finally, you should add your NET custom action after "Install Execution Stage -> Add Resources" action group as deferred and follow our "How do I get installer properties in .Net Installer Class Custom Actions?" article steps to pass a property to a NET custom action. Also, you can take a look on our "Debug a .Net Installer Custom Action" article which could be useful.

Also, if you are using our "Services" page to install your services, then you can add in the "Service name" and "Display name" fields, from "Service Properties" right pane, the formatted references of your installer properties. For example, you can set the "Display name" field like this:

Code: Select all

[DISPLAY_NAME]
Let us know if this helps, otherwise please send us the .aip (project file) to support at advancedinstaller dot com so we can check its settings and try to give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BMKyle
Posts: 4
Joined: Wed Nov 12, 2014 5:09 pm

Re: Service Instance Installer [Help!]

-- EDIT --

UPDATED BELOW
Last edited by BMKyle on Mon Nov 17, 2014 5:05 pm, edited 1 time in total.
BMKyle
Posts: 4
Joined: Wed Nov 12, 2014 5:09 pm

Re: Service Instance Installer [Help!]

Hi again,

I've made some good progress now; I can install my service instances with the passed in parameters and can now have multiple instances of services. I achieved this by using the Custom Action .NET Installer Class to override the default service name, display name and description. This override reads in the Service.exe.config xml file which is modified by the passed in parameters. All works well.

My problem now is that even when using /qn I get the Instance popup (after I have installed the first instance) which prompts me to install new instance/Maintain or upgrade already installed instance. Reading up on the subject took me to :


http://www.advancedinstaller.com/user-g ... s-cli.html

Having looked at the above link I encounter the following error with the command:

Code: Select all

setup.exe /newinst 5 INSTANCE_ID="CUSTOMER_500" SERVICE_NAME="ServiceInstance1" SERVICE_DISPLAY_NAME="DATA HANDLER FOR CUSTOMER 500" SERVICE_DESCRIPTION="HANDLE DATA FOR CUSTOMERS" /qn
[/b]

The Installer pops up with Error, Invalid command line when using /newinst 5, (Same when i use /newinst "5"). What am I doing wrong?


Thanks,

Kyle
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service Instance Installer [Help!]

Hello Kyle,

I'm not sure why this happens. Can you please send us the .aip (project file) and a detailed step by step test case which we can follow, to support at advancedinstaller dot com so we can investigate the behavior?

If you cannot make a disclosure of your project file, then you can try to isolate the behavior in a buildable sample and send it us so we can test and investigate it.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”