Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Running a *.MSI setup file


  • Please log in to reply
15 replies to this topic

#1 mFm

mFm

    Seeker

  • Active Members
  • 14 posts

Posted 25 May 2008 - 11:25 AM

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







#2 Jos07

Jos07

    Wayfarer

  • Banned (NOT IN USE)
  • 55 posts

Posted 25 May 2008 - 11:33 AM

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, 25 May 2008 - 11:36 AM.

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

#3 mFm

mFm

    Seeker

  • Active Members
  • 14 posts

Posted 25 May 2008 - 12:55 PM

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

#4 mFm

mFm

    Seeker

  • Active Members
  • 14 posts

Posted 28 May 2008 - 05:56 AM

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.

#5 enaiman

enaiman

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,922 posts

Posted 28 May 2008 - 06:20 AM

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, 28 May 2008 - 06:22 AM.

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 :)


#6 system24

system24

    It has been a while.

  • Active Members
  • PipPipPipPipPipPip
  • 555 posts

Posted 28 May 2008 - 08:55 AM

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

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


#7 mFm

mFm

    Seeker

  • Active Members
  • 14 posts

Posted 28 May 2008 - 12:09 PM

i use the following code to succesfully run the application.

ShellExecute("MyFile.msi")


#8 Mrinaldi

Mrinaldi

    Seeker

  • Active Members
  • 6 posts

Posted 28 May 2008 - 08:08 PM

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')

#9 secman

secman

    Seeker

  • Active Members
  • 20 posts

Posted 07 January 2009 - 09:51 AM

Thanks this has solved a problem for me as well.
Secman

#10 stoneheart

stoneheart

    Seeker

  • Active Members
  • 12 posts

Posted 21 March 2010 - 05:31 PM

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

#11 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 11,278 posts

Posted 21 March 2010 - 06:15 PM

Try just ShellExecute()

#12 stoneheart

stoneheart

    Seeker

  • Active Members
  • 12 posts

Posted 22 March 2010 - 07:29 AM

Thanks JohnOne its working

#13 TuxBird

TuxBird

    Seeker

  • New Members
  • 3 posts

Posted 09 February 2011 - 03:28 PM

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, 09 February 2011 - 03:29 PM.


#14 hannes08

hannes08

    my oh my

  • Active Members
  • PipPipPipPipPipPip
  • 943 posts

Posted 09 February 2011 - 03:57 PM

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

#15 MHz

MHz

    Just simple

  • MVPs
  • 5,660 posts

Posted 10 February 2011 - 01:00 PM

...

"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. :)

#16 TuxBird

TuxBird

    Seeker

  • New Members
  • 3 posts

Posted 14 February 2011 - 11:28 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users