cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
BobVilla
Level 6

Accepting Command line parameters with Basic MSI Project

How do you set up a Basic MSI project to accept command line variables? Can I have it populate the property manager with the values passed in with the command line?
I have several Basic MSI projects that I am building and want them to accept command line values. I am using the Basic MSI projects to build exe/msi files to be used in a suite project. Building my custom dialogs in the suite project to get settings from the user and passing them to the exe/msi files. I just don't know how to get the exe/msi files to know what to do with them once they are passed in.
Labels (1)
0 Kudos
(10) Replies
lasiewicz
Level 6

Use the MSI command line builder. Its under tools in installshield. Its very helpful.
0 Kudos
BobVilla
Level 6

I thought the command line builder just built the output command line string
0 Kudos
ilirqt
Level 4

BobVilla wrote:
How do you set up a Basic MSI project to accept command line variables? Can I have it populate the property manager with the values passed in with the command line?
I have several Basic MSI projects that I am building and want them to accept command line values. I am using the Basic MSI projects to build exe/msi files to be used in a suite project. Building my custom dialogs in the suite project to get settings from the user and passing them to the exe/msi files. I just don't know how to get the exe/msi files to know what to do with them once they are passed in.


If you have a property in a suite then you can pass it to msi using MSI (Silent) Command Line.
Let's say you have a text box in wizards with propery XYZ to pass it to msi you add to Packages/Operation/Install Command Line: XYZ="[XYZ]"
The first part is a property in MSI and quoted is the value from text box in suite.

In MSI it could be whatever like username for a service, a condition whether to fire a CA, etc.

Hope it makes sense
0 Kudos
BobVilla
Level 6

I understand passing from the suite project to the Basic (exe or msi). I guess what I am missing is what do I have to do to make the basic(project) realize that there is a value coming through the command line and what to do with it.
0 Kudos
ilirqt
Level 4

BobVilla wrote:
I understand passing from the suite project to the Basic (exe or msi). I guess what I am missing is what do I have to do to make the basic(project) realize that there is a value coming through the command line and what to do with it.


I'm going to give you a very simple example.

Make a checkbox in suite wizard and set property field to DONTINSTALL, assign for the package Install MSI command lines DONTINSTALL="[DONTINSTALL]"

On basic msi at General Information in Install Condition add a condition:
Condition: DONTINSTALL<>"true"
Message: Something

What this will do is if you tick the checkbox in suite during install the MSI will not install.

This way you can pass on properties and catch them in MSI projects.
0 Kudos
BobVilla
Level 6

So, you don't have to set up some kind of container in the Basic project to handle the incoming variables in the command line. Just use the variable name that is passed in and the EXE file will just recognize it?

What I am doing is building Basic MSI projects, exporting them as MSI/EXE files, and building a Suite project to point to the individual Basic installs. For some reason none of the custom dialogs from my Basic projects are displaying when the Suite project runs them ( even though if I run them outside of the Suite project they do show up ). So, I am re-building the custom dialogs in the Suite project and passing the variables from the Suite dialogs into the Basic project in place of the dialogs in the Basic project.

So, I can use the command line variable in the condition statements. Can I put them in the Property Manager? Example: Create a new property called CHECKINSTALL, and in the Value column put {DONTINSTALL} ?
0 Kudos
ilirqt
Level 4

BobVilla wrote:
So, you don't have to set up some kind of container in the Basic project to handle the incoming variables in the command line. Just use the variable name that is passed in and the EXE file will just recognize it?


No you don't have setup any container, the MSI will just recognize the property, i.e. if the property is somewhere in MSI, like in my example a condition.

What I am doing is building Basic MSI projects, exporting them as MSI/EXE files, and building a Suite project to point to the individual Basic installs. For some reason none of the custom dialogs from my Basic projects are displaying when the Suite project runs them ( even though if I run them outside of the Suite project they do show up ). So, I am re-building the custom dialogs in the Suite project and passing the variables from the Suite dialogs into the Basic project in place of the dialogs in the Basic project.


The MSI dialogs will never be visible when ran through Suite, since suite basically silent installs the packages, that's why you need to specify MSI Silent Command Line

So, I can use the command line variable in the condition statements. Can I put them in the Property Manager? Example: Create a new property called CHECKINSTALL, and in the Value column put {DONTINSTALL} ?


I'm not sure about this one, i don't know if you can put variable properties in properties manager since I personally use property manager to give a property a specific value not variable, instead i use the variable in custom actions, dialogs, IIS configs, etc. in [PROPERTY] format.
0 Kudos
BobVilla
Level 6

These variables that are passed from my Suite install to my Basic project are really just pass again as command line variables to another DLL in my Basic project. The command line(for the Basic project DLL) references the Property Manger values.

Can I just put the DONTINSTALL in the second command line?
0 Kudos
ilirqt
Level 4

BobVilla wrote:
These variables that are passed from my Suite install to my Basic project are really just pass again as command line variables to another DLL in my Basic project. The command line(for the Basic project DLL) references the Property Manger values.


The property manager really just manages values for properties, if your DLL refers to a property named XYZ in property manager, have a property in Suite called XYZ and have it in silent command line XYZ="[XYZ]" it will be exactly the same as if you put it in property manager.


Can I just put the DONTINSTALL in the second command line?


I don't understand what you mean with second command line?
0 Kudos
BobVilla
Level 6

The first answer, answered the second one. I have a command line going from the suite project to the Basic project. Then I have a "second" command line passing the values from the Basic project to the Components through the .NET Installer Class Arguments. That was what I was calling the "second" command line. I think this will work... thanks so much!
0 Kudos