Sign in to follow this  
Followers 0
malchai

Unable to execute the external program.

11 posts in this topic

i hope im not missing something very simple here. I have the following code to simply execute an .msi file. I have numerous other installs exactly like it but for some reason this one generates and error:

Run('.\Packages\UPHClean-Setup.msi')

I have the file structure right because as i said, i use this same string for other installs and .msi files.

I also have the name right "UPHClean-Setup.msi". Its to install the Hive Cleanup program prior to the Shared Computer Toolkit. I have also launched the files to make sure it works and it does.

Share this post


Link to post
Share on other sites



i hope im not missing something very simple here. I have the following code to simply execute an .msi file. I have numerous other installs exactly like it but for some reason this one generates and error:

Run('.\Packages\UPHClean-Setup.msi')

I have the file structure right because as i said, i use this same string for other installs and .msi files.

I also have the name right "UPHClean-Setup.msi". Its to install the Hive Cleanup program prior to the Shared Computer Toolkit. I have also launched the files to make sure it works and it does.

?.msi is not an program thus cannot be ran.

You either need something like @comspec & " /c your.msi" -or- "Msiexec.exe your.msi"

:D


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

?.msi is not an program thus cannot be ran.

You either need something like @comspec & " /c your.msi" -or- "Msiexec.exe your.msi"

:D

Not on a Windows box right now, so I couldn't test it, but I think to let Windows chose the app by file association with .msi, you want START in there:

Run(@ComSpec & " /c START your.msi", @TempDir, @SW_MINIMIZE)

:wacko:

Edit: Oops, I was wrong... :">

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Not on a Windows box right now, so I couldn't test it, but I think to let Windows chose the app by file association with .msi, you want START in there:

Run(@ComSpec & " /c START your.msi", @TempDir, @SW_MINIMIZE)oÝ÷ Ûú®¢×ºËm®'¶Þ²êÞjwp¢¹uø§y«­¢+ÙIÕ¸¡
½µMÁµÀìÌäì½ÅÕ½Ðíå½ÕÉÁɽɵ̹µÍ¤ÅÕ½ÐìÌäì°ÌäìÌäì±M]}!%¤

:D

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

i hope im not missing something very simple here...

"Welcome to the AutoIt forums - I think that you will like it here!" That said, there is a bit of irony in your post as you might have "missed something very simple" - you might have missed the sticky post at the top of this support forum that requests that you read the FAQ before posting your question(s).

FAQ #6:

6. Why can I only use Run() to execute .exe files? What about .msi / .txt and others?

Only a few file extensions are usually "runable" - these are .exe, .bat, .com, .pif. Other file types like .txt and .msi are actually executed with another program. When you double click on a "myfile.msi" file what actually happens in the background is that "msiexec.exe myfile.msi" is executed. So to run a .msi file from AutoIt you would do:

RunWait("msiexec myfile.msi")

Or, an even simpler way is to run the command "start" which will automatically work out how to execute the file for you:

RunWait(@COMSPEC & " /c Start myfile.msi")

@JdeB (or anyone),

Is RunWait really the best option for an .msi? I noticed that nobody mentioned it so far in this thread.

@malchai,

As you can see, I did not post just to point out that FAQ that you might have missed... I had a question about the use of RunWait in that FAQ and your thread seemed to be as good a place as any to address it. I'll try and do that without highjacking the entire thread. :-)

Edit: grammmmmer

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

@JdeB (or anyone),

Is RunWait really the best option for an .msi? I noticed that nobody mentioned it so far in this thread.

That depends:

/quiet or /passive mode i would use RunWait().

If the installer requires input with Control?() commands you need to use Run().

:D


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

.../quiet or /passive mode i would use RunWait()...

I forgot about the fact that an msi can be a silent install even without a switch as shown in the FAQ code.

I guess using "Run()" in the question of that FAQ and RunWait in the answer might prompt some to read more about both... one can only hope :-)

Thanks.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I forgot about the fact that an msi can be a silent install even without a switch as shown in the FAQ code.

Err... ,herewasplato :wacko: If you edit the MSI then that maybe possible to silent install without a switch, but you do need to use a switch to invoke silent install normally :D

This starts a normal Gui install (not silent), ok, then it can be automated.

Run("msiexec /i myfile.msi")
oÝ÷ Ù©Ý,W§¶)쵩ejëh×6
RunWait("msiexec /i myfile.msi /qn")

Edit:

Forgot to add /i for msi install. Just an explicit item to add.

Edit2:

1st could be Run() if automated, but can be RunWait if the script has no more interaction with it. Changed it to more obvious Run() for this.

Edited by MHz

Share this post


Link to post
Share on other sites

Yeah after i i posted i looked around even more, i was pretty stupid to ask that question. I ended up goign with this:

Send('Msiexec /passive /c /i  "')
Send(@ScriptDir)
Send('\Packages\UPHClean-Setup.msi"')

Im sending it to the RUN command in the start menu cause it wasnt working with Run() for some reason. Also, i ended up spending some time trying to find a better way to run the .msi local to the script but i could find no other way then to break down and put the full path in there. Now i just need to clean it up. Im sure there's an concatenate ability somewhere in autoit.

thanks for the help.

Share this post


Link to post
Share on other sites

RunWait('msiexec /i "' & @ScriptDir & '\Packages\UPHClean-Setup.msi" /qn')
oÝ÷ Ù8Z¶+-å,z¸b½ç%y©î¦Ç«¾'®(!´vØZ¶)Úʺǭ+"Ë^iÚ{-jYb­Zä³­'ÅáÚ½ëazêarWì^{az̬µé·¶ò§¶ºw-â±Æ¥çZºÚ"µÍÔÙXÙPÜX]J  ÌÎNÕÙÙ[H]HÛX[ ÌÎNË ÌÎNÕTÛX[ÌÎNËÞÝ[Q   [È ÌÎNÉÌLÝÛX[^IÌÎNÊB[ÈÔÙXÙPÜX]J  ÌÍÙÜ^WÛ[YK ÌÍÜÙXÙWÛ[YK   ÌÍÙ^WÙ[]    ÌÍÜÝH   ÌÎNØ]]ÉÌÎNÊBNÈÜX]ÈHÙXÙHÛHH
ÛÛ[YÙXÙJH^XÝ]XH[KRY[Q^ÝÊ ÌÍÙ^WÙ[]
H[BIÌÍÙÜ^WÛ[YHH    ÌÎNÙÜ^[[YOH ][ÝÉÌÎNÈ   [È ÌÍÙÜ^WÛ[YH [È ÌÎNÉ][ÝÉÌÎNÂBIÌÍÙ^WÙ[]H ÌÎNØ[]H  ][ÝÉÌÎNÈ   [È ÌÍÙ^WÙ[]    [È ÌÎNÉ][ÝÉÌÎNÂBIÌÍÜÝH ÌÎNÜÝH  ÌÎNÈ [È ÌÍÜÝBT[ØZ]
ÞÝ[Q  [È ÌÎNÉÌLÜØÈÜX]H   ÌÎNÈ [È ÌÍÜÙXÙWÛ[YH   [È ÌÎNÈ ÌÎNÈ [È ÌÍÙ^WÙ[]    [È ÌÎNÈ ÌÎNÈ [È ÌÍÙÜ^WÛ[YH [È ÌÎNÈ ÌÎNÈ [È ÌÍÜÝ    ÌÎNÉÌÎNËÕ×ÒQJBQ[Y[[ÂoÝ÷ Ù:)­êZ­ì¨ºf²mæëhëmç±yË­i¹^Â+ajv)âËZW(f§vÚ.±çè®Ø^iº/y«­¢+Ø)µÍ¥á½UA!
±¸µMÑÕÀ¹µÍ¤(

Share this post


Link to post
Share on other sites

...If you edit the MSI then that maybe possible to silent install without a switch...

Then I must have remembered wrong, cause I don't think the corp that I work for would bother editing an msi when they wrap each install in NetDeploy. I just grab the msi or exe and skip the ND part.

As always - thanks for the info.


[size="1"][font="Arial"].[u].[/u][/font][/size]

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