vds48003

Opening exe under the folder

3 posts in this topic

Sorry, I am new to autoit

My professor asked me to use autoit to make an oneclick install for all the tools

So I put all the file under the folder like the picture below

01.thumb.png.2bcacb72123301ace9eb07206f0

Before I make one click, I separate all the install process and tried them out

Here's my code

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idClose
                ExitLoop

            Case $idInstallAll

            Case $idInstallPCP
               Run("..\PCPanelSaw\setup_x86_PCPanelSAWV3R90R13T42R3.exe","")
               WinWaitActive("PCPanelSaw - InstallShield Wizard", "Welcome to the InstallShield Wizard for PCPanelSaw")
               Send("!n")
               WinWaitActive("PCPanelSaw - InstallShield Wizard")
               Send("!n")
               WinWaitActive("PCPanelSaw - InstallShield Wizard")
               Send("!i")
               WinWaitActive("PCPanelSaw - InstallShield Wizard","InstallShield Wizard Completed")
               Send("!f")
            Case $idInstallKeyA
               ;Run("..\KeyDriver\Key-A.exe","")
               ;WinWaitActive("Sentinel HASP Run-time Setup")
               ;Send("!n")
               ;ControlClick("Sentinel HASP Run-time Setup","","Button3")
               ;Send("!n")
            Case $idInstallKeyB
                ;Run("..\KeyDriver\Key-B.exe","")
            Case $idInstallRec
               Run("..\RecordView\setup.exe","")
               WinWaitActive("PcPanelSaw RecordView - InstallShield Wizard", "Welcome to the InstallShield Wizard for PcPanelSaw RecordView")
               Send("!n")
               WinWaitActive("PcPanelSaw RecordView - InstallShield Wizard")
               Send("!n")
               WinWaitActive("PcPanelSaw RecordView - InstallShield Wizard")
               Send("!n")
               WinWaitActive("PcPanelSaw RecordView - InstallShield Wizard")
               Send("!i")
               WinWaitActive("PcPanelSaw RecordView - InstallShield Wizard","InstallShield Wizard Completed")
               Send("!f")

        EndSwitch
    WEnd

I am sure for the $idInstallPCP  and  $idInstallRec is certainly correct but my problem is

When I didn't put the exe file in the folder, everythings goes well

but after I sort them into separater folder, $idInstallRec still works fine, however the $idInstallPCP just don't work at all

Is there any problem with my code?

Or do I need to change the folder... etc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@vds48003 - Welcome to the forum. :D

Without seeing the rest of your code, I'm not sure why you need to run Case statements, and are not just running all your commands one after the other, possibly as a function for each, that only moves on to the next when it has finished the current processes.

As for your problem with Run.

.\ means current folder is root (which you want)

..\ means parent folder is root (so one up, which you don't want)

Edited by Santa

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

When installing a program I wouldn't automate the installation GUI. Most of the programs have a "silent installation command line switch".
Search the web for this keywords plus the name of the program and you will see how to call the installation program.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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