Jump to content

Opening exe under the folder


vds48003
 Share

Recommended Posts

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

Link to comment
Share on other sites

@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

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...