PDA

View Full Version : Error 2721 calling MSIExec from an msi


Keiths123
07-31-2008, 03:39 PM
I am trying to create an MSI that installs another MSI using MSIExec with command line parameters and I get an error code 2721 when it runs.

Annoyingly enough I copied this code from Setup Factory 6 where it works perfectly.

The MSI I have created contains nothing but an msi and a Data1.cab file. I install it to a specific directory and then I call a custom action to run an executable. I have selected Full path with working folder and the path is:
C:\Windows\System32\msiexec.exe

I then put in command line arguments that specify the exact install location of MSI that i have just installed, plus some other stuff to get it to run silently, select drivers and so on. (I will use variables for this but only after I have removed the issue)

If I build and run the msi if extracts the files and then gives me the error 2721.

The questions are:
Am I doing this the correct way?
Why am I getting the error?

I need to optionally install the final msi dependant on user choices as they may not have the device so we will break license agreements if we install it every time.

Help!

Keiths123
07-31-2008, 03:44 PM
I forgot to mention: After getting the error I can copy the details from the custom action into 'Start, run' and it runs perfectly. :huh

Keiths123
07-31-2008, 05:00 PM
Not working fix 2:

I created a batch file that took a command line parameter of the msi I just placed on the local machine, effectively replacing the direct run executable method, and then called this from the MSI I created.

It appears to run as I had the bat file have a pause command in it so I could see what was going on...and it doesn't appear to install!

Is there something within the MSIExec itself that stops MSI's being run when there are other MSI's running? I'm going into "Add or Remove Programs" to see if the installation has run correctly and it is not showing in there. Maybe this is the problem?

Keiths123
07-31-2008, 05:15 PM
Just found the solution. ( I hope you are enjoying my ramblings...)

You cannot call an MSI from an MSI. Great.

You can use BootStrapper: http://blogs.msdn.com/chrsmith/articles/Using_the_Bootstrapper_to_wrap_a_Windows_Installer _package.aspx

but it's a prerequisite so I don't know if I can optionally install dependent on user configurations. Ho hum, on we go.