Create self-extracting installer from 3 pre-existing windows MSI files

Posted on 2010-08-16
Last Modified: 2013-12-01
Greetings and thank you for a moment of your time,

I've got 3 pre-existing MSI files, which I did not create.  I just want to chain them into a compressed self-extracting archive, which then kicks them off automatically in the correct order.  Ideally, I just email them the link, and it's pretty automated from there, with the exception of the Wizards resultant from the MSI packaging.

This is unimportant.  The single file I send them a link to, might as well be an exe, zip, or whatever, as long as it will self-extract automatically on Windows XP Professional, with as few clicks as possible, and begin the installation automatically (of the 3 MSI files).

I'm not allowed to deploy these MSI's via GPO (my preferred method, and much easier too!), so in the meantime, I'm trying to find a simple method to avoid confusing my customers, or frustrating them.  Fewer mouse clicks is the goal here.  Having them download them individually, then find the location, and kick them off one at a time, is like pulling teeth.

I've got Winrar, but I'm not opposed to Alzip, 7-zip, Inno, etc., whatever is easiest and works.

Question by:ksuchy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33447046
I would create SFX file in Winrar, with the 3 MSI's inside, plus vbscript or .cmd that would run the msi's in the correct order, and since you don't want the dialogs, with switch /qb . You then specify that script in SFX options under "run after extraction".

Expert Comment

ID: 33447047

Author Comment

ID: 33448392
Thank you for the suggestion, I will keep that on the burner for now.

I've never included a vbscript like that before, because I've never put multiple files in like this, which need to be kicked off in order (I'm assuming you've used vbscript in similar cases).  Can you give me a link or some of the basic lines of vbscript I'd use in that scenario?  Would the script need to kick off one of the msi files, then wait somehow, for some amount of time, or maybe a prompt, before moving to the 2nd, and then 3rd?

thanks so much!,
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 40

Expert Comment

by:Vadim Rapp
ID: 33448490
See article "Run Method (Windows Script Host)" ( ) for details; it has an example. As you can see, there's parameter bWaitOnReturn, so each line will wait for completion before moving to the next one.

Each command to run would be msiexec.exe /qb /i package1.msi .

The command to run vbscript itself would be wscript.exe myscript.vbs (run wscript /? to see all parameters).

With Installer 4.5, there's also an interesting possibility to run all 3 installations as one transaction, so if one fails, others rollback as well. But creating the script providing that is more involved.

Author Comment

ID: 33449884
Ok!  I've got another ticket to help me if I run into problems with the VBscript now (I'm so lucky you two showed up to help me!)

Baring some problem with the script or my tests, I'll try to get this working (tested on VM's), and then report back soon (2 days max).

Thanks Vadimrapp1 & Deisrobinson so much!

Author Comment

ID: 33451391
It doesn't seem to work with any variant of %dir% no matter how many quotes (including none at all).  Note, that I also attempted other paths, such as: %HOMEPATH%\My Documents


Author Comment

ID: 33451393
I also just attempted to run the vbscript directly -- aka, from a prompt:

 \My Documents>wscript.exe installer.vbs
LVL 40

Accepted Solution

Vadim Rapp earned 500 total points
ID: 33451509
Well, I just double-checked: put trivial installation package in %temp%, then ran the following script:

set s=createobject("") "msiexec /qb /i ""%temp%\test.msi""",1,true "msiexec /qb /x ""%temp%\test.msi""",1,true

and it correctly installed it, then uninstalled.

Author Comment

ID: 33451615
triple quotes.  that was it! "msiexec.exe /qb /i ""%temp%\test.msi"",1,True" << original

I was modifying the quotes in all possible ways, other than the correct way: "msiexec /qb /i ""%temp%\test.msi""",1,true

I'll retry the exe in the morning.

thanks :-)

Author Comment

ID: 33459395
I've got one last question.  
When I'm at a cmd prompt, it doesn't seem to make any difference if I type:

>wscript.exe installer.vbs

or if I type


why type the wscript.exe?
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33459481
To account for (very unlikely but not entirely impossible) case when filetype .vbs is associated not with wscript.exe but something else. In programming, the recommended practice is to always specify explicitly whatever can be specified.

Actually, I'd say, it's recommended not only in programming. The less assumptions, the better.

Author Comment

ID: 33460597
Just an FYI:

My reason for asking about the invocation of the vbscript by the use of (tell me if I say this the wrong way) by handing off the vbscript to the wscript object intentionally, is this:

In a sleep-deprived stupor last night (about 2 am), I found that I could compile the vbscript into an .exe and then create a nice little wizard that actually looks like a traditional installer using either:

So I tested this, and sure enough, it works!   These two programs above work for me (non-profit), and and far more simple than NSIS or INNO.

I'm was wondering if I should go back and try to change the file association in my test VM, for the vbs filetype, and then rerun.   I probably will.  But I already think (now) that this file name extension won't affect the vbscript being executed as part of my install exe, because when the vbs is compiled into an exe, the wsh object model is simulated somehow, as if all the classes and types are linked or pulled in somehow, and a sort of wsh is actually being used to run the vbs, in the same way that it would if I called wscript.exe from the command prompt as you have suggested I do.

I haven't learned this much in a single Q&A thread, in my entire life.  

Thanks so much!


Author Comment

ID: 33460605
I should clarify:  I'm still using your vbscript (thank you).  But now I'm using a nice install wizard with a "branded" splash screen I made, my own organizational icon, license agreement, readme, etc., all in a single .exe.  

I'm going to do one more test tomorrow.  
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33460947
Actually, sfx in winrar that you mentioned in the very beginning also supports branded icon and license. Readme probably might be launched in the end either by the installation, or by yet another lince in the script.

Author Closing Comment

ID: 33485593
worked great, thanks so much!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
No disk drive 17 100
Mac Installer for Firefox 48 4 136
How to instal SSRS in visual studio 2010 2 20
SBS secondary domain installation 9 35
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
I wrote an article ( some time ago with a reference to nLite  ( software.  I recently changed that link to point to NTLite (https://www.ntl…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question