Calling MSIEXEC from Installer

Comments

2 comments

  • Avatar
    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>
    
  • Avatar
    tahoar

    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>
    

Please sign in to leave a comment.