ct253704 Posted September 26, 2014 Share Posted September 26, 2014 This simple script is giving me issues. All I want to happen, if the checkbox is checked, is for BOTH the messagebox to appear with the CD-KEY in it AND the install file to run at the same time. This returns the Multi-line IF missing Then error in this format, but I've tried a lot of different approaches and can't seem to get them both to run at the SAME time. I can either get the message box first and then the program won't run until it's closed or the message box second after the program is installed. However, I need to enter the key before the program finishes installing so I would like them both to open at the same time. Switch $EchoValue Case $GUI_CHECKED Local $EchoExists = FileExists ("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 1 Then MsgBox (0, "ECHO CD-Key", "###-####-###") And ShellExecuteWait("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 0 Then MsgBox (0, "ECHO", "ECHO Executable Missing! Check server connection.") EndSwitch I've tried using 2 variables as well and doing the IF AND IF THEN ELSE combo and can't seem to make it work that way either. Suggestions? Link to comment Share on other sites More sharing options...
MikahS Posted September 26, 2014 Share Posted September 26, 2014 (edited) You'll need to have two scripts if you want two actions to occur at the same time (at least that is my understanding). EDIT: Shows my understanding Go Melba and DarthCookieMonster! Edited September 26, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted September 26, 2014 Moderators Solution Share Posted September 26, 2014 (edited) ct253704,Use a SplashTextOn dialog or my Toast UDF (look in my sig for the link) - both of those will allow you to keep the dialog visible while the script continues. M23 Edited September 26, 2014 by Melba23 Wrong UDF! Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Bert Posted September 26, 2014 Share Posted September 26, 2014 (edited) This simple script is giving me issues. All I want to happen, if the checkbox is checked, is for BOTH the messagebox to appear with the CD-KEY in it AND the install file to run at the same time. This returns the Multi-line IF missing Then error in this format, but I've tried a lot of different approaches and can't seem to get them both to run at the SAME time. I can either get the message box first and then the program won't run until it's closed or the message box second after the program is installed. However, I need to enter the key before the program finishes installing so I would like them both to open at the same time. Switch $EchoValue Case $GUI_CHECKED Local $EchoExists = FileExists ("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 1 Then MsgBox (0, "ECHO CD-Key", "###-####-###") And ShellExecuteWait("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 0 Then MsgBox (0, "ECHO", "ECHO Executable Missing! Check server connection.") EndSwitch I've tried using 2 variables as well and doing the IF AND IF THEN ELSE combo and can't seem to make it work that way either. Suggestions? You "could" do this: 1. make a script that only has the message in it. 2. Change your script to this: Switch $EchoValue Case $GUI_CHECKED Local $EchoExists = FileExists ("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 1 Then RUN("message.exe") ;message is displayed and the ShellExcuteWait line will also run without delay ShellExecuteWait("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") endif If $EchoExists = 0 Then MsgBox (0, "ECHO", "ECHO Executable Missing! Check server connection.") EndSwitch Edited September 26, 2014 by DarthCookieMonster The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ct253704 Posted September 26, 2014 Author Share Posted September 26, 2014 (edited) Both good suggestions, thank you guys. I ended up using splashtext simply because I like fewer files and I had never used that option before (it's awesome!) so I wanted to toy with it. Thanks for the help another problem solved. Edit: Added final working switch Switch $EchoValue Case $GUI_CHECKED SplashTextOn ("ECHO CD-Key", "###-####-###", 300, 75, -1, -1, 50, "", 12, -1) Local $EchoExists = FileExists ("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 1 Then ShellExecuteWait("\\fileserver01\disks\Echo\Echo_Upgrade_112613\9.1.2.4\Install_EchoWorkstation_912.msi") If $EchoExists = 0 Then MsgBox (0, "ECHO", "ECHO Executable Missing! Check server connection.") SplashOff () EndSwitch Edited September 26, 2014 by ct253704 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now