Sign in to follow this  
Followers 0
tsicoupe

Running setup file with paramaters

8 posts in this topic

#1 ·  Posted (edited)

Hello,

I am having an issue getting this program to install correctly. If i run the following command in a command prompt it installs exactly how i want it to:

msiexec /i "SMARTEducationSoftware.msi" INSTALL_NOTEBOOK=1 INSTALL_BOARD=1 ENABLE_MATH_TRIAL=0 INSTALL_RESPONSE=1 INSTALL_INK=1 DESKTOP_ICONS="" CUSTOMER_LOGGING=0 NB_PROD_KEY=XX-XXXXX-XXXXX-XXXX-XXXXX-AAA ACTIVATE_LICENSE=1 NETWORK_CONTENT=1 CONTENT_TARGET_PATH="domaindatasmartgallery" /qn
 
i tried having a script open the command prompt and then use the send command to send that as a long keystroke but i keep getting syntax errors. I also tried to compile it using ShellExecute and i get the same syntax errors. I know its obviously something i am typing wrong but if you could help me out or if there is a better way of doing this i would appreciate any help.
 
This is what i tried:
 
Run("C:\Windows\System32\cmd.exe")
WinWaitActive("C:\Windows\System32\cmd.exe")
send('cd C:appssmart14.2)' & "{ENTER}")
send("msiexec /i "SMARTEducationSoftware.msi" INSTALL_NOTEBOOK=1 INSTALL_BOARD=1 ENABLE_MATH_TRIAL=0 INSTALL_RESPONSE=1 INSTALL_INK=1 DESKTOP_ICONS="" CUSTOMER_LOGGING=0 NB_PROD_KEY=XX-XXXXX-XXXXX-XXXXX-XXXXX-AAA ACTIVATE_LICENSE=1 NETWORK_CONTENT=1 CONTENT_TARGET_PATH="domaindatasmartgallery" /qn{ENTER}")
 
as well as
 
 
ShellExecute("msiexec.exe" [, "/i "SMARTEducationSoftware.msi" INSTALL_NOTEBOOK=1 INSTALL_BOARD=1 ENABLE_MATH_TRIAL=0 INSTALL_RESPONSE=1 INSTALL_INK=1 DESKTOP_ICONS="" CUSTOMER_LOGGING=0 NB_PROD_KEY=XX-XXXXX-XXXXX-XXXXX-XXXXX-AAA ACTIVATE_LICENSE=1 NETWORK_CONTENT=1 CONTENT_TARGET_PATH="domaindatasmartgallery" /qn"])
 
Edited by tsicoupe

Share this post


Link to post
Share on other sites



try:

ShellExecute("msiexec.exe" , '/i "SMARTEducationSoftware.msi" INSTALL_NOTEBOOK=1 INSTALL_BOARD=1 ENABLE_MATH_TRIAL=0 INSTALL_RESPONSE=1 INSTALL_INK=1 DESKTOP_ICONS="" CUSTOMER_LOGGING=0 NB_PROD_KEY=XX-XXXXX-XXXXX-XXXXX-XXXXX-AAA ACTIVATE_LICENSE=1 NETWORK_CONTENT=1 CONTENT_TARGET_PATH="\\domain\data\smartgallery" /qn')

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)

try to answer the above!  :bye:

Edited by Detefon

m(o.O)m

Share this post


Link to post
Share on other sites

thanks that did work, lastly i am trying to delete a registry entry when that program is finished installing. This is what i did:

 
ProcessWaitClose("msiexec.exe")
RegDelete("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun", "SMART Floating Tools")
 
only problem is msiexec stays running after the setup is complete so it never processes this command unless you manually end the process. Any suggestions on that? Maybe i could have it wait until a shortcut file exists then process that command since the registry entry would of been created by then. How would i do that?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

ShellExecute and Run return the ProcessID.

So you can do :

$iPid = ShellExecute("msiexec.exe" , '/i "SMARTEducationSoftware.msi" INSTALL_NOTEBOOK=1 INSTALL_BOARD=1 ENABLE_MATH_TRIAL=0 INSTALL_RESPONSE=1 INSTALL_INK=1 DESKTOP_ICONS="" CUSTOMER_LOGGING=0 NB_PROD_KEY=XX-XXXXX-XXXXX-XXXXX-XXXXX-AAA ACTIVATE_LICENSE=1 NETWORK_CONTENT=1 CONTENT_TARGET_PATH="\\domain\data\smartgallery" /qn')

ProcessWaitClose($iPid)
Edited by jguinch

Share this post


Link to post
Share on other sites

Only problem with that is every time i launch it the pid changes.

Share this post


Link to post
Share on other sites

His example doesn't care if the PID changes, not sure why you feel that's an issue.

There's also ShellExecuteWait (read description in the help file)

Or for your suggestion to wait for a shortcut, you can always use FileExists() in a loop:

ShellExecute("data here")

While Not FileExists("path\filename.lnk")
    Sleep(100) ; for cpu resting
WEnd

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

ShellExecuteWait worked, thanks for all 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