Sign in to follow this  
Followers 0
bourny

Msiexec question

14 posts in this topic

I am rolling out adobe8 using Msiexec and had this a few times but used the setup.exe instead to work around . Thsi issue I have is Msiexec spawns multiple processes and makes internal decisions that leaves me in a position where i cannot tell if the install has completed.

Example.

Run adobe8 msiexec install with adobe 8 already install will leave an msiexec process behind once completed. My script cannot tell if the install (or repair) has completed or not - Thsi is not an issue with the interactive mode as the last window is the indication the install has completed.

The purpose of MSIexec is to allow silent install but leaves you with no way of telling the core install has finished...

I know the msiexec can be left over to allow other msiexec process to be aware that other installs are sill active..

Any ideas on this ....

thanks

Share this post


Link to post
Share on other sites



If you know the GUID of the Adobe product check msiGetProductState() (or something like that) from msi.dll ... it returns 5 if the product is already installed...

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

Do you eventually get success if you spam the install process over and over? If so you could use RegRead, FileGetVersion, etc. to test for the presence and correctness of registry entries and files as a measure of success, and rinse/repeat until things are correct. Otherwise, you can find the uninstall string for the current Adobe product at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall in the systems registry and run that first, or see if Adobe offers a cleanup EXE that will uninstall any previous version in an automated way and run that before you start.

Do you have any Windows Installer authoring tools? I ask because in the past when I've had to deal with poorly-behaved/unpredictable installers, both SETUP.EXE-based and MSI-based, I've found that the best solution for my environment was to make a new simple Windows Installer MSI that tests for whatever I judge that a valid install would have (reg key, file present and correct version), and configure it so that the "install" of this MSI fails if all my criteria aren't present. I then make this MSI the primary installer for the app, and the poorly behaved installer a dependency to be pre-installed; as long as the success criteria for my own Windows Installer package fail and it returns a Windows Installer failure my distribution framework (Novell ZENWorks) will continue to try to redistribute it, including the dependent "real" package...

Or do what Larry says.


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

Thanks for the replies.

Larry - I will look at this msiGetProductState() you mention and see what I can extract from it. I am not so much interested if it is already installed as I will use regreads for that but more interested if it has finished its routines and the left ove msiexec process is idle.

I guess that is a better explanation - is the msiexec install routine in an idle (completed state) then I can continue my script once it is ion this state. It would be nice for the msiexec process to die once completed but it does not (depending on your .mst / command lines)

DaveF - I can easily loop in AutoIt until the registry install Guids are correct however i am then making an assumption that the Guids are only present when the product / msi process has finished all its tasks. For any install I automate I always like to be sure the installer has finished all its inbuild functions before I continue. This is the issue with .msi that I cannot tell if it is finished its routine or not. detecting a prescence of a guid is a mere assumption this is the last thing the msi does ( I doubt it will be )

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Also, you may want to consider looking at the install options that the adobe8 installer supports. We deploy it at work by using the command-line params "setup.exe /sAll /rs". There's nothing wrong with thinking outside the box, but why re-invent the wheel if you've already got one that works.

Edited by spudw2k

Share this post


Link to post
Share on other sites

Also, you may want to consider looking at the install options that the adobe8 installer supports. We deploy it at work by using the command-line params "setup.exe /sAll /rs". There's nothing wrong with thinking outside the box, but why re-invent the wheel if you've already got one that works.

Looks good use the setup.exe instead of .msi for adobe - I can tell if the install is complete when the setup.exe dies

It appears to also remove previous products but gives out a message at the end that "this action is only valid for products that are currently installed" - have you a link explaining what the /sAll /rs are and if any others are available

My main question still stands however as this is post is generally regarding msi installs and how to detect on a progress only install the processes have completed due to the left behind msiexec process. I am trying to use msi due to the extra power I get from it.

I have looked at Larry`s post but it is not returning any value - just get a 0 in the message box

http://www.autoitscript.com/forum/index.ph...mp;#entry503534

Share this post


Link to post
Share on other sites

Also, you may want to consider looking at the install options that the adobe8 installer supports. We deploy it at work by using the command-line params "setup.exe /sAll /rs". There's nothing wrong with thinking outside the box, but why re-invent the wheel if you've already got one that works.

Looks good use the setup.exe instead of .msi for adobe - I can tell if the install is complete when the setup.exe dies

It appears to also remove previous products but gives out a message at the end that "this action is only valid for products that are currently installed" - have you a link explaining what the /sAll /rs are and if any others are available

My main question still stands however as this is post is generally regarding msi installs and how to detect on a progress only install the processes have completed due to the left behind msiexec process. I am trying to use msi due to the extra power I get from it.

I have looked at Larry`s post but it is not returning any value - just get a 0 in the message box

http://www.autoitscript.com/forum/index.ph...mp;#entry503534

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Pasted from: http://www.adobe.com/devnet/acrobat/pdfs/d...ing_reader8.pdf Page 10

/sAll

Run installer in silent mode.

/sPB

Silent mode with minimum UI, Progress Bar only.

/rs

Reboot Suppress. Setup.exe will not initiate reboot even if it is required.

/rps

Reboot Prompt Suppress. If reboot is required, the system restarts without warning.

/ini "PATH"

Relative or absolute path to an alternative (different) Bootstrapper INI file. The CmdLine of alternative INI will be ignored.

/l

Enable Error Logging. Log file Bootstrap.log will be generated in temp directory.

/sl "LANG_ID"

Set Language, where LANG_ID is the decimal code of the destination installation language. Use it only for the multilingual installer, and make sure that the corresponding language transform file exist in the setup directory. If /sl "LANG_ID" is not set and you are running the multilingual installer interactively (not silently), Choose Setup Language dialog will be displayed.

/msi[Command line]

Identifies the portion of CmdLine for additional MSIEXEC command line parameters. Everything following /msi is passed to MSIEXEC without analyzing and without any changes.

See Windows Installer Command-Line Options: http://msdn.microsoft.com/library/default....ine_options.asp ).

Edited by spudw2k

Share this post


Link to post
Share on other sites

You can use the Adobe Customization wizard to repackage Acrobat. I did that, and it will install with just running the setup.exe. It will compleatly automate the entire install including the e-license

Thanks again all..... I now have my answer to how to get adobe to behave but still need to know generally how to detect a msi has completed if running as msiExec. As mentioned larrys suggestion looks good but I am failing to get a return code from a Guild I make as the variable ...

Share this post


Link to post
Share on other sites

$ret = DLLCall("msi.dll","int","MsiQueryProductState","str",$data)

where $ret[0] is the state ...

where $data, a GUID, is properly formatted ... "{some-guid-here-with-dashes}"

Must see failing code and know where you get GUID from.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

Thanks Larry,

I think I am doing something wrong or misunderstanding how this should work but I am attempting the following

$data = "{AC76BA86-7AD7-1033-7B44-A80000000002}"

$ret = DLLCall("msi.dll","int","MsiQueryProductState","str",$data)

Msgbox(0, "", $ret)

I plan to put this in a loop to check the GUID of the application I am installing via msiExec and I am guessing the $ret will return 5 once it detects the product is installed. - At the moment mt message box returns nothing... - The guid I am checking for is adobe8 and is installed already - I tried running this while the installer is in progress but always get the same blank return.

(I will be using the setup.exe routine above for adobe install but trying to use adobe to crack the ability to check is a MSIexec install has completed ok)

Thanks

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Thanks Larry,

I think I am doing something wrong or misunderstanding how this should work but I am attempting the following

$data = "{AC76BA86-7AD7-1033-7B44-A80000000002}"

$ret = DLLCall("msi.dll","int","MsiQueryProductState","str",$data)

Msgbox(0, "", $ret)

I plan to put this in a loop to check the GUID of the application I am installing via msiExec and I am guessing the $ret will return 5 once it detects the product is installed. - At the moment mt message box returns nothing... - The guid I am checking for is adobe8 and is installed already - I tried running this while the installer is in progress but always get the same blank return.

(I will be using the setup.exe routine above for adobe install but trying to use adobe to crack the ability to check is a MSIexec install has completed ok)

Thanks

going from what lar posted above i assume that $ret is an array. so you would have to use Msgbox(0, "", $ret[0])

I have no experience with using dll calls though so i could be completely wrong. I'm still very much learning :D

Edited by Rotahn

Share this post


Link to post
Share on other sites

going from what lar posted above i assume that $ret is an array. so you would have to use Msgbox(0, "", $ret[0])

I have no experience with using dll calls though so i could be completely wrong. I'm still very much learning :D

- you are correct - this works

Do

$data = "{AC76BA86-7AD7-1033-7B44-A81200000003}"

$ret = DLLCall("msi.dll","int","MsiQueryProductState","str",$data)

Until $ret[0] = 5

MsgBox(0, "Matched", $ret[0])

I tried running the installer for Adobe and put this script above in to test when the guid is detected - This detected and outputted at the end of the install - The 4 msiexec processes took around 30 seconds longer to reduce down to the 1 msiexec process. I can now put a detection in once the 5 is returned I can wait for the multiple msiexec processes to die back down to 1 and I will then be in a good place to assume the install has completed ..

Thanks again ....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0