SO, I am creating an installer for a piece of software that requires other software to be installed. This is already available and packaged in an MSI file, and I know the command to run to install it. 'msiexec /i myprog.msi /passive (could do /q for quiet here if thats better...) INSTALLDIR=....'

How do I package the MSI with my Installer, and then make sure that it gets copied to a directory so that I can run the msiexec command.

Sorry if this is common knowledge, but I am new to InstallBuilder...

My Sample Code...

<runprogram> 
    <program>msiexec</program> 
    <programarguments>/i httpd-2.2.22-win32-x86-no_ssl.msi /q ALLUSER=1 SERVERADMIN="admin@localhost" SERVERNAME="localhost" SERVERDOMAIN="localhost" SERVERPORT=8080 SERVICENAME="Apache8080" INSTALLDIR="C:Program Files (x86)Apache2.2"</programarguments> 
    <progresstext>Installing Apache Web Server</progresstext> 
    <usemsdospath>0</usemsdospath> 
    <workingdirectory>${installer_directory}</workingdirectory> 
</runprogram>

Thanks!

asked 28 Jun '12, 16:53

rickschneider17's gravatar image

rickschneider17
1112
accept rate: 0%


I found a solution to install .msi's (Python and Perl) and answered my own question here:

http://answers.bitrock.com/questions/1172/installing-python-msi-on-windows

I think you're close. I believe the some options (/I and /L) are case-sensitive, which is unusual for Microsoft. Try this, I rearranged your command line to match the one that works for me:

<runprogram> 
    <explanation>Installing Apache Web Server</explanation> 
    <program>msiexec</program> 
    <programarguments>/qn /L*v "C:\apacheinst.log" /I "${installdir}/InstallFiles/httpd-2.2.22-win32-x86-no_ssl.msi" ALLUSER=1 SERVERADMIN="admin@localhost" SERVERNAME="localhost" SERVERDOMAIN="localhost" SERVERPORT=80 SERVICENAME="Apache2.2" INSTALLDIR="C:\Program Files (x86)\Apache2.2\"</programarguments>
    <progresstext>Installing Apache Web Server</progresstext> 
    <usemsdospath>0</usemsdospath> 
    <workingdirectory>${installdir}</workingdirectory> 
</runprogram>
link

answered 04 Jul '12, 23:27

tahoar's gravatar image

tahoar
201313236
accept rate: 42%

This did not work for me. I still get the same issue with the msiexec "about/usage" window popping up. In fact, I created a new installer that just tried the MSIEXEC command, and it still fails. I am however, able to have InstallBuilder call my bat file, which in turn calls msiexec, and that works properly. But its a workaround at best.

(05 Jul '12, 11:38) rickschneider17

If a batch file works, don't fight it. Based on that, I bet the space in "Program Files" is the problem. Just for fun, work the command so there are not any quotes after the upper-case variable names, and set the install directory to something without a space, like INSTALLDIR=C:\Apache2.2

(06 Jul '12, 06:41) tahoar

That seems to the be the fix.... installing APACHE to something other then Program Files, or any DIR with a space. I need to try to put the "'s back in and see if that ok.

(09 Jul '12, 10:50) rickschneider17

If that is the error, you can create a variable with the path:

<setInstallerVariable name="apache_dir" value="${windows_folder_program_files}\apache2.2"/>

And then use it without quotes and with the .dos suffix:

         <runprogram> 
           <program>msiexec</program> 
           <programarguments>/i ${installdir.dos}/httpd-2.2.22-win32-x86-no_ssl.msi ... INSTALLDIR=${apache_dir.dos}</programarguments> 
            <progresstext>Installing Apache Web Server</progresstext> 
            <usemsdospath>0</usemsdospath> 
        </runprogram>
(09 Jul '12, 12:06) juanjo ♦♦

If the msi is packed in the installer, you could either execute your code in the <postInstallationActionList>, when all files are already unpacked, or use the <unpackFile> action:

<project>
  ...
  <componentList>
     <component>
       <name>apache</name>
       <description>Apache</description>
       <folderList>
         <folder>
           <name>apache_msi</name>
           <description>Apache MSI</description>
           <distributionFileList>
              <distributionFile>
                <origin>/path/to/httpd-2.2.22-win32-x86-no_ssl.msi</origin>
              </distributionFile>
           </distributionFileList>
         </folder>
       </folderList>
       <readyToInstallActionList>
           <unpackFile>
              <component>apache</component>
              <folder>apache_msi</folder>
              <origin>httpd-2.2.22-win32-x86-no_ssl.msi</origin>
              <destination>${installdir}</destination>
           </unpackFile>
           <runprogram> 
               <program>msiexec</program> 
               <programarguments>/i ${installdir.dos}/httpd-2.2.22-win32-x86-no_ssl.msi /q ALLUSER=1 SERVERADMIN="admin@localhost" SERVERNAME="localhost" SERVERDOMAIN="localhost" SERVERPORT=8080 SERVICENAME="Apache8080" INSTALLDIR="C:Program Files (x86)\Apache2.2"</programarguments> 
                <progresstext>Installing Apache Web Server</progresstext> 
                <usemsdospath>0</usemsdospath> 
            </runprogram>
       </readyToInstallActionList>
     </component>
  </componentList>
  ...
</project>
link

answered 02 Jul '12, 05:15

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

The MSI is not packaged with the Installer, but I guess I could try that..

(02 Jul '12, 10:52) rickschneider17

If it is not packed then your original code should work assuming the msi was placed in the same dir as the installer. Also, in your snippet, the INSTALLDIR does not appear to have backslashes (but it could be a typo while writing the snippet in the post)

(02 Jul '12, 11:09) juanjo ♦♦

So, I have tried to package it with the installer as well, and I am getting the same error. Basically, the msiexec window pops up, as if I am just running 'msiexec' directly off the command line. Then an error message appears, and the parameters are all correct... so I dont know what is wrong.

(02 Jul '12, 14:50) rickschneider17

<runprogram> <explanation>Installing Apache Web Server</explanation> <program>msiexec</program> <programarguments>/i "${installdir}/InstallFiles/httpd-2.2.22-win32-x86-no_ssl.msi" /l*v "C:\apacheinst.log" /qn ALLUSER=1 SERVERADMIN="admin@localhost" SERVERNAME="localhost" SERVERDOMAIN="localhost" SERVERPORT=80 SERVICENAME="Apache2.2" INSTALLDIR="C:\Program Files (x86)\Apache2.2\"</programarguments> <progresstext>Installing Apache Web Server</progresstext> <usemsdospath>0</usemsdospath> <workingdirectory>${installdir}</workingdirectory> </runprogram>

(02 Jul '12, 14:51) rickschneider17

Could you execute the installer as:

installer.exe --debugtrace debug.txt

And send us the generated file to support@bitrock.com

(02 Jul '12, 15:58) juanjo ♦♦

It has been generated and sent.

(02 Jul '12, 21:56) rickschneider17
showing 5 of 6 show all
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×54
×36
×12
×11
×10
×8
×3

Asked: 28 Jun '12, 16:53

Seen: 5,392 times

Last updated: 09 Jul '12, 12:06