Sign in to follow this  
Followers 0

Running a *.MSI setup file

16 posts in this topic

#1 ·  Posted

I want to run a setup file and use the following code to run the file.

Run("setup.msi")
i also try
run("setup.msi","")
N.B. Both script and msi setup file are in same directory[folder]

and then i save the script and run it. but nothing happens whats wrong with my code? did it run an msi file.? if not then how can i run the setup file. any alternatives.?

Any idea what's wrong with my code ??? looking 4 help

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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, run the command \\\"start\\\" which will automatically work out how to execute the file for you:

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

Or, use the ShellExecuteWait function which will automatically work out how to execute the file for you:

ShellExecuteWait(\\\"myfile.msi\\\")

Note : Please avoid \\ because i dont know why it comes with every post while i uses commas.

Edited by Jos07

Always Keep Your Sig Small... Like me :D

Share this post


Link to post
Share on other sites

#3 ·  Posted

thanks man i will try this and 4 your problem use [*co*de][*/*co*de] code tags to enclose your coding this way whatever u write stays that way.

N.B. without asterisk

Share this post


Link to post
Share on other sites

#4 ·  Posted

no hope i was to unable to run it any one else please i need to run this.

your first runwait statement. all possible way that i supposed i checked.

1 . > RunWait(,\"msiexec myfile.msi,\")

2 . > RunWait(\,"msiexec myfile.msi\,")

non of the above code works.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

In order to avoid any error use the full path for your msi file.

RunWait("msiexec the_full_name_including_path_of_your_msi_file")

or as Jos07 suggested:

ShellExecuteWait("myfile.msi")

(use also the full file name)

Edited by enaiman

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#6 ·  Posted

In order to avoid any error use the full path for your msi file.

RunWait("msiexec the_full_name_including_path_of_your_msi_file")

or as Jos07 suggested:

ShellExecuteWait("myfile.msi")

(use also the full file name)

If the msi file and the executed script are in the same folder, you could use this:

ShellExecuteWait(@ScriptDir & "\myfile.msi")
;myfile.msi contains a backslash because @ScriptDir does not have one

[center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted

i use the following code to succesfully run the application.

ShellExecute("MyFile.msi")

Share this post


Link to post
Share on other sites

#8 ·  Posted

I use this normally

RunWait('msiexec /options for install/patch "path to MSI" /options for quiet install /log ' & $WorkDir & '\MSI LOG.txt PROPERTIES')

to install

RunWait('msiexec /i \\server\directory\setup.msi /qb /log ' & $WorkDir & '\log.txt REINSTALL=All REINSTALLMODE=vomus')

to patch an admin install

RunWait('msiexec /p \\server\share\ArcGISAdminInstall\Service_packs\SP5\ArcGISDesktop92sp5.msp /a \\server\share\ArcGISAdminInstall\Setup.msi /qb /Log \\server\share\ArcGISAdminInstall\Service_packs\SP5\arcview.sp5.txt')

Share this post


Link to post
Share on other sites

#9 ·  Posted

Thanks this has solved a problem for me as well.

Secman

Share this post


Link to post
Share on other sites

#10 ·  Posted

I have problem with ShellExecuteWait

coz After running the requested program the script pauses until the requested program terminates

so the script is stoped until i close the prog

Share this post


Link to post
Share on other sites

#12 ·  Posted

Thanks JohnOne its working

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I am trying to recreate a LanDesk script with AutoIt and I am having difficulties getting it to work any assistance would be great.

the original script went:

"msiexec", para="/i \\servername\RPAA\myfile.msi /qb /Lv* "C:\RP_install.log" PATHINI="\\server\RPAA\Config.ini""

I think using the ShellExecute is the way to go but I can't get the syntax correct.

Edited by TuxBird

Share this post


Link to post
Share on other sites

#14 ·  Posted

Hello TuxBird,

take a look at the helpfile under Contents => Language Reference => Datatypes. Look at the "Strings" paragraph.

As far as I can see fro your example you've got a quote-problem.

Regards,

Hannes

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

#15 ·  Posted

...

"msiexec", para="/i \\servername\RPAA\myfile.msi /qb /Lv* "C:\RP_install.log" PATHINI="\\server\RPAA\Config.ini""
...

Welcome TuxBird,

The "para= ..." property does not look correct to me. The property value i.e. "/i", looks like the switches you should be passing direct to msiexec instead.

Try this for Run().

Run('msiexec /i "\\server\RPAA\myfile.msi" /qb /lv* "C:\RP_install.log" "PATHINI=\\server\RPAA\Config.ini"')

or perhaps try this with ShellExecute().

ShellExecute('"\\server\RPAA\myfile.msi"', '/qb /lv* "C:\RP_install.log" "PATHINI=\\server\RPAA\Config.ini"')

Take note of how the single quotes wrap around the whole of the string parameters so the double quotes within are valid to be passed. Use the workingdir parameter if required. :)

Share this post


Link to post
Share on other sites

#16 ·  Posted

I did have a quote problem but I got it to go with the following:

ShellExecute("msiexec", '/i \\server\setup.msi /qb /Lv* C:\RP_install.log PATHINI=\\server\application\Config.ini')

Thanks for the help.

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