Building a MSI


So I have done some reading, and found several helpful links here on itninja... but I still have a question/problem.

I am using Install Shield 2013 to make an MSI. I am using a custom action to make a basic MSI wrapping up a custom exe file. (I wrote a scipt and then converted it to a exe using a program called AutoIT).

I have created the MSI with the CA and everything seems to build correctly. However, when I run it on my test machine the MSI goes through its steps and I can even see the executable launch, However, the commands in the exe don't actually take effect. My exe is set to remove a program via cmd line... I see the cmd shell pop up, but the program does not actually get removed. Simplified: my msi is executing the exe file - but the commands are not actually executing. Does that make sense?

Now... before you ask. Yes, the exe works just fine outside of the MSI. If I just run the exe, without the MSI wrapper, it functions as it should and all is well. But i need the MSI so I can deliver and automated function to my users.

Also, I noticed in Install sheild I set where the "package" is to be delivered to the target machine. If I go to that file path on the target machine, I can drill down and actually find the exe file - so it seems as if the MSI just installed (copied) the desired exe to the C: of the machine - then I (or the user) would have to manually launch the exe. this is not the desired outcome.

Any thoughts as to what I can do differently am doing wrong?

Am I possibly misunderstanding the idea of a CA with a exe, in that it just delivers the exe OR can be used to execute an existing exe on the machine??

2 Comments   [ + ] Show comments
  • Could you tell me what your CA settings are and where in the MSI it is set to execute? - olditguy 8 years ago
  • I am not sure how to tell you the settings of the CA, is there a specific setting you are looking for?
    The MSI is currently on my C: - but in the build of the CA a new file path is created C:\Users\ProgramFiles\Mycompanyname\myprogramname and the file is "installed" there. - jsnyder213 8 years ago
    • You'll need a CA to execute the file after it has been installed on to the PC. - olditguy 8 years ago
      • So basically. My first CA will just "install" the EXE on the machine, and then I need to create a totally different CA that actually executes it? That is a bummer. Do you have any suggestions as to how I could get it all done in one action instead of 2? - jsnyder213 8 years ago

Answers (2)

Answer Summary:
Posted by: olditguy 8 years ago
Second Degree Blue Belt

My suggestion is

Create your MSI. Create the folder structure you want by creating folders in Files and Folders pane in Installshield. Then add the .exe as a file into the folder.

Set the .exe as the key for the component if it is not already set (right-click, set key file).

This part just installs the file but doesn't run it

Now we make a CA to run the file.

On the Custom actions pane create a new CA. Right-click Custom actions then choose New EXE > Installed with product.

Click on this CA and in the Action page on the right, select your .exe for "Executable Keyfile".

Set return processing to "Synchronous (ignore exit code)"

In-script execution should be "Deferred Execution in System context". This allows it to run with elevated permissions.

In the Install Exec sequence choose "After Install Files"

In the Install Exec Condition type  NOT INSTALLED

This means your CA will only run at install time.

Give this a go and see what you get.

  • OK, in Files and Folders I have created the path : ProgramFiles\My company Name\My Product Name - in here i put my exe and set it as a key file.

    I made the CA as suggested. (I compared this process to a CA I had already built, and a few of the sequences are different - so I think this will work...) however
    I built the MSI and ran it on my test machine and got the error stating that it could not verify the file exist. - I watched the process, it creates the file structure, it just does not put the .exe in the folders... thus the error.

    I can send screen shots if need be. - jsnyder213 8 years ago
    • How did you build the MSI? Sounds like you created it uncompressed with the data files externally.

      For example you might have a folder structure under your build release, make sure you include this wherever you run the .msi from. - revel 8 years ago
      • So I guess my question then is, how do I compress it? I am just building a basic MSI (I tried to add a screenshot, but can't seem to figure that out.) Under the Application Data folder on the left side of Install Shield - under "Files and Folders" I create a file path on the "destination computer" and drop my exe into that file path (I assumed this meant that the MSI build would create this file path on the target machine and put the file there as a part of the install... maybe I am wrong??)

        so... maybe I am assuming to much. My main question is... can I build an MSI that will put the needed exe files on the target machine, and then execute that file? - jsnyder213 8 years ago
    • To make a compressed MSI containing all the files check that under Releases that your Release (usually called Release 1) has the compression option set to MSZIP. This should give you an MSI containing the file. - olditguy 8 years ago
      • Oh man. I think I am close! I built a compressed file (it created a setup.exe instead of an MSI) the setup now installs the exe on the target machine... NOW the only part I am missing is the actual execution of the exe that is installed on the target machine. I assume this will be done with the CA, which I am not sure why it wouldn't do it since I have the CA already built in the ISM?? - jsnyder213 8 years ago
      • Check that your exe is set as the key path in its component. Check that the CA that runs the exe is after install files. When you run the msi use /L*v LogFileName then look in the log to see if the CA is being triggered. - olditguy 8 years ago
      • I can't reply to the last comment in the chain...but I think I am so very close. I built it as a compressed build and it created a setup.exe - I put that on my target machine and ran it, and it "installed" the exe and then exectued the exe from the CA as it should. I know this, becasue I saw the CMD windows pop up that would be generated based on my script I wrote. Now, I need to find out what is going on with that, becasue even though the exe executed... it did not acutally uninstall the program as scripted.

        so, it is working, but only at about 90%!! - jsnyder213 8 years ago
      • Good! Can you add logging into your exe so you can see what its (not) doing? - olditguy 8 years ago
      • I was able to do the suggested log file for the MSI - I am going to look through that tomorrow. But I was also able to get a screen shot of the message displaying when the CMD window closed. (not going to lie. I was super fast and lucky to get this!)
        But that says:
        Method execution successful.
        Out parameters:
        instance of _PARAMETERS
        ReturnValue = 1618;

        I have not looked into this yet, but I thought I would share. Also, just so you know my EXE is running a simple CMD line: wmic product where caption="ArcGIS Desktop" call uninstall

        My EXE works if I do it manually or if I go to the file path created in the MSI... I just get the above message when I run the actual MSI file. - jsnyder213 8 years ago
      • I think it may be a problem of calling an uninstall from within an install if both are using msiexec. Assuming ArcGIS Desktop was installed by an msi. Error 1618 from an msi is "Another install is in progress". - olditguy 8 years ago
      • Originally the ArcGIS was installed with a batch file, that used a MSI, the batch file also installed a few add-on's, but those were EXE files.

        I think you are on to something though with the install calling an uninstall. I think that is what is breaking.

        Do you have any suggestions how I can get around that? Maybe I can use one MSI to "install" my custom EXE on the target machine. And then have a seperate MSI that runs the CA that actually executes the EXE?? essentially, building 2 deliverable packages? - jsnyder213 8 years ago
      • You might be able to do it with MSI 4.5 and chained msi's but it's not something I've ever done so I'm not sure if it's a solution. Have a look at http://www.flexerasoftware.com/producer/resources/white-papers/is-chainedmsi.html - olditguy 8 years ago
Posted by: jsnyder213 8 years ago
Senior White Belt

Top Answer

I just wanted to responsed to this thread and give an update (and "close" it). While working with some of the guidance provided from here, I was also attempting to work with Flexera support on a solution as well. I was finally able to get a hold of someone with a willingnes to help.

Instead of Install Shield, with a Custom Action, they suggested using Install Sheild and using Install Script. With this solution, I could script my needed executable commands (via CMD line) in the script and then launch msiexec and install my MSi created via AdminStudio.

In the end, I believe this is going to work... I just need to hammer out a few of the little details.

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ