Sign in to follow this  
Followers 0
cxcio

how to use the RUN function to run a msi file !?

10 posts in this topic

#1 ·  Posted (edited)

Run ( "program.msi" ) not working !!!

Edited by cxcio

Share this post


Link to post
Share on other sites



Try this:

Run( @SystemDir & "\msiexec.exe /I program.msi" )

=MX

Share this post


Link to post
Share on other sites

I'm trying to get the autoit variable $var to replace the info in quotes.

Run( @SystemDir & "\msiexec.exe /I program.msi" )

I need to be able to run three programs in series. Not always the same program, hence the INI.

I tried:

EnvSet("ENVAR", $var)

Run(@COMSPEC " /c Start %ENVAR%")

Basically, I can't figure out how to get @comspec to read an AutoIt variable.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I'm trying to get the autoit variable $var to replace the info in quotes.

Run( @SystemDir & "\msiexec.exe /I program.msi" )

I need to be able to run three programs in series.  Not always the same program, hence the INI. 

I tried:

EnvSet("ENVAR", $var)

Run(@COMSPEC " /c Start %ENVAR%")

Basically, I can't figure out how to get @comspec to  read an AutoIt variable.

; EnvSet("ENVAR", $var) don't think you need this..
Run(@COMSPEC " /c Start " & ENVAR)
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

To read a Key/Value in an INI file, you can use the "IniRead()" function (check the doc). Here's a code snippet:

$var = IniRead("C:\myfile.ini", "section2", "key")

; Use "&" to concatenate strings
Run(@ComSpec & " /c Start " & $var)

Hope this helps!

=MX=

Share this post


Link to post
Share on other sites

Worked perfectly! thank you!

Share this post


Link to post
Share on other sites

OK one more and I'll stop bugging you:

Command line is {the name of the script,} {the name of the ini file to read}.

$ini = $CmdLine[1]

It gets this, I can Echo the $ini variable correctly

But:

$var = IniRead("& $ini &", "launch", "1", "NotFound")

Always comes back "not found"

tried this:

$var = IniRead(" & $ini & ", "launch", "1", "NotFound")

and this:

$var = IniRead($ini, "launch", "1", "NotFound")

and this:

$var = IniRead(" & $ini & ", "launch", "1", "NotFound")

What am I doing wrong?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This is the correct version....

$var = IniRead($ini, "launch", "1", "NotFound")

are you sure that the INI is in the same directory as the default path or are you supplying the whole path to the ini file ??

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

I didn't that was why it wasn't going.

:D

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