Solved

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

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

THE REQUEST:
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.

FORMAT:
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).

CAVEATS:
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.

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

THANK YOU :-)
0
Comment
Question by:ksuchy
  • 9
  • 5
15 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
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".
0
 
LVL 7

Expert Comment

by:deisrobinson
Comment Utility
0
 

Author Comment

by:ksuchy
Comment Utility
Deisrobinson,  
Thank you for the suggestion, I will keep that on the burner for now.

Vadimrapp1,  
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!,
~k
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
See article "Run Method (Windows Script Host)" ( http://msdn.microsoft.com/en-us/library/d5fk67ky%28VS.85%29.aspx ) 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.
0
 

Author Comment

by:ksuchy
Comment Utility
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!
0
 

Author Comment

by:ksuchy
Comment Utility
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

0
 

Author Comment

by:ksuchy
Comment Utility
I also just attempted to run the vbscript directly -- aka, from a prompt:

 \My Documents>wscript.exe installer.vbs
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
Comment Utility
Well, I just double-checked: put trivial installation package https://filedb.experts-exchange.com/incoming/ee-stuff/7973-test.MSI in %temp%, then ran the following script:


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



and it correctly installed it, then uninstalled.
0
 

Author Comment

by:ksuchy
Comment Utility
triple quotes.  that was it!

s.run "msiexec.exe /qb /i ""%temp%\test.msi"",1,True" << original

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

I'll retry the exe in the morning.

thanks :-)
0
 

Author Comment

by:ksuchy
Comment Utility
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

>installer.vbs

why type the wscript.exe?
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
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.
0
 

Author Comment

by:ksuchy
Comment Utility
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:

http://www.bersoft.com/easysetup/
or
http://www.ssesetup.com

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!

0
 

Author Comment

by:ksuchy
Comment Utility
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.  
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
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.
0
 

Author Closing Comment

by:ksuchy
Comment Utility
worked great, thanks so much!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Find out what hardware you have and get the most up to date drivers from the manufacturer! Automatically Get Your Drivers There is a number of great programs that will detect your hardware and find drivers for you automatically! Here is a link …
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now