Jump to content

Running setup file with paramaters


tsicoupe
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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?
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...