Need help on building installer in the MSI format using Installaware

Got a problem you cannot solve? Try here.
manoj
Posts: 5
Joined: Mon Jul 17, 2017 6:12 am

Need help on building installer in the MSI format using Installaware

Postby manoj » Mon Jul 17, 2017 10:55 am

Hi,

We are using InstallAware Studio Admin X3.

We are building our product only in EXE format but now our client has requirement of installer in the MSI format as they want to use it in SCCM. We accomplished this by selecting the build type option "Build MSI outputs instead of EXE outputs" in Build settings section along with "Compressed Single Self-Installing EXE". (Please confirm, if this is the correct way of building MSI based installer)

Now whenever I executes the MSI installer built from InstallAware it first extracts in the temp folder and from there executes EXE which was contained in the MSI.

Below are the questions related to this:

1. Is this the way MSI installer works (means EXE is wrapped into MSI and is extracted and then the EXE is executed) ?
2. When I passed command line parameters with MSI (with MSIEXEC command) for our custom variables defined in the script the values passed was not reflecting inside the script neither in the predefined variable CMDLINE nor in the actual variable. Same is the case with pre-defined inbuilt variables . How to access the values passed through command line parameters for custom variables and for pre-defined variables which are passed to the MSI into my script so that I can customize the installer flow at time of installation?

Please help with above queries.

Thanks
Manoj

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Need help on building installer in the MSI format using Installaware

Postby FrancescoT » Mon Jul 17, 2017 12:58 pm

Dear Manoj,

as first, you may eventually deploy exe type applications as well with SCCM.
http://gerryhampsoncm.blogspot.it/2013/03/sccm-2012-sp1-step-by-step-guide-part_20.html
https://www.youtube.com/watch?v=EYGMsu5KCPQ

1. Not exactly in this way. The Exe gets called, but the real installation job is done by the the wrapped MSI.

2. With MSI files, variables and values have to passed through the "CMDLINE" public MSI property

For example;
msiexec.exe /i "C:\mypackage.msi" CMDLINE="MY_FIRST_PROPERTY=TRUE MY_SECOND_PROPERTY=FALSE"

https://www.installaware.com/forums/viewtopic.php?f=2&t=10783&hilit=CMDLINE
https://www.installaware.com/forums/viewtopic.php?f=2&t=10772&hilit=CMDLINE

Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

manoj
Posts: 5
Joined: Mon Jul 17, 2017 6:12 am

Re: Need help on building installer in the MSI format using Installaware

Postby manoj » Tue Jul 18, 2017 11:49 am

Hi FrancescoT,

Thanks for reply.

I have followed as you said but I am unable to capture the value passed from command line from MSI code. The variable is not returning the value I am setting from command line.

Below is the code I am using:

For calling I am using batch file having below code:

Code: Select all

  msiexec.exe /i "C:\mysetup.msi" /l*x "C:\MSI\log.txt" CMDLINE="EXCLUDE_PREREQUISITES=TRUE"


Inside script below is the code:

On top I have declared the variable as

Code: Select all

  Set Variable EXCLUDE_PREREQUISITES to FALSE


In the later stage of code I used below code for setting the value read from command line. Here $EXCLUDE_PREREQUISITES$ always returns FALSE and not the value passed from command line:

Code: Select all

if Variable CMDLINE contains EXCLUDE_PREREQUISITES
  Set Variable EXCLUDE_PREREQUISITES to $EXCLUDE_PREREQUISITES$
end


Please help how to accomplish this.


Also for logging I am using /l switch with msiexec.exe command but it only logs MSI related steps only, it does not log the data and the steps from MSIcode in script. Is there any other way for this I want to log what is happening inside the MSICODE.

Thanks
Manoj

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Need help on building installer in the MSI format using Installaware

Postby FrancescoT » Tue Jul 18, 2017 1:19 pm

Dear Manoj,

for what you posted, your approach is correct. However, there must be an error somewhere, otherwise it would have worked.

If you have a chance to send me a VERY MINIMAL PROJECT that replicates the issue, I'll try to have a look.

Bye the way, you can also place some message-boxes in your code to verify the content of CMDLINE variable at setup runtime.
For sure, there is an error somewhere in your code.

For logging, you need to pass the /l switch into the CMDLINE variable.
CMDLINE"/l=C:\MSI\log.txt EXCLUDE_PREREQUISITES=TRUE"

Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

manoj
Posts: 5
Joined: Mon Jul 17, 2017 6:12 am

Re: Need help on building installer in the MSI format using Installaware

Postby manoj » Tue Jul 18, 2017 1:49 pm

Dear FrancescoT,

I used messagebox and it shows all the commandline parameter correctly in CMDLINE but when i try to access the value against the variable EXCLUDE_PREREQUISITES by using dollar sign i.e. $EXCLUDE_PREREQUISITES$ it doesn't return the value which i have passed in commandline although it shows whole commandline correctly in message box.

For logging i have already tried your suggestion but it only logs end lines only it is not logging the steps of installer. I will paste snapshot of that tommorow as i am messaging this from my cell phone rt now.

I will also try to make sample code if i can and send that tommorrow because its night here in my timezone. In meantime if you have any clue you can tell me so that i can try it tommorrw as iam stuck there and this is the priority project i am working on.

By the way when you generally remain online and what is your timezone so that i can connect you and get quick reply if possible.

Thanks again
Manoj

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Need help on building installer in the MSI format using Installaware

Postby FrancescoT » Tue Jul 18, 2017 2:11 pm

Dear Manoj,

the best solution, it's that you post a very minimal project that exposes the problem. I'll do all my best to reply to you as soon as I can.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

manoj
Posts: 5
Joined: Mon Jul 17, 2017 6:12 am

Re: Need help on building installer in the MSI format using Installaware

Postby manoj » Wed Jul 19, 2017 12:12 pm

Dear Francesco,

Please find attached MSI.zip file.

The zip file is having sample project folder stating the problem which I talked of in earlier comment and a batch file for executing the .msi file. Please update the path in batch file.

Thanks in advance
Manoj
Attachments
MSI.zip
(1.22 MiB) Downloaded 277 times

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Need help on building installer in the MSI format using Installaware

Postby FrancescoT » Thu Jul 20, 2017 5:00 am

Dear Manoj,

attached you find my edited copy of your project.

Because you are initializing a script variable from command line, you have to initialize this to itself at very beginning of your script. Otherwise, the variable will be overwritten by the value assigned through the "Set Variable" command.

Alternatively, you may use the following approach;

Code: Select all

Set Variable EXCLUDE_PREREQUISITES to FALSE
if Variable CMDLINE Contains EXCLUDE_PREREQUISITES=TRUE
  Set Variable EXCLUDE_PREREQUISITES to TRUE
end

As I said previously, to log the MSI process, also the "/l" switch has to be passed from CMD PROMPT with the CMDLINE parameter.
*Please note, it must exist the target path specified with the "/l" switch.

NOTE!
With the Windows Installer engine, logged execution will create a log file and record both the internal state of the installation (along with all variable values) and the native Windows Installer log inside a plain text file. Since all changes are pending until Apply Changes is called, the log will be created only after Apply Changes has been called.

Hope this helps you.

Regards
Attachments
MSI.zip
(1.22 MiB) Downloaded 274 times
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 31 guests