Jump to content

Autoit EXE:s problem


Recommended Posts

Hi!

I made few of my setups with AutoIT, now i tryed to install XP with Virtual PC, and saw what happend. Autoit script setups didn't start install, they made errors, because they tried to look the original exe from my WINXP\$OEM$\... folder, and ofcourse didn't find it because the map drive was changed like C:\install, how do define in my script to look for the original exe from %systemdrive%\install\Applications\ ?

Edited by Pete_
Link to comment
Share on other sites


I do not understand you method os software deployment i.e. RunOnceEx, GuiRunOnce... and when you are deploying the software. I do not know where your AutoIt scripts are i.e. perhaps in $OEM$ folder somewhere? If your scripts are in the same directory as the installers, are you using @ScriptDir to path to the files?

For all I know, it could be that you are hardcoding the paths? But a wild guess as I have not enough information to help you :( .

Link to comment
Share on other sites

The script exe:s made from au3 files are in the same directory than original setup exe:s i.e %systemdrive%\install\Applications\

The script exe is right, because its defined in RunOnceEx to be in %systemdrive%\install\Applications,

but the original exe,isn't defined, and its in C:\$OEM$\install\App... during I made the script from it, so now when it tries to install in Windows startup, it tries to find the original exe from that place not from %systemdrive% ..... -> C:\install

Link to comment
Share on other sites

Would you be able to show your RunOnceEx that shows it as entering this information for the script.exe's. Also show me the Run() functions used in the Au3 scripts.

Link to comment
Share on other sites

Yes, you were right, the Run() path was wrong it was (C:\WINXP\....), i corrected it now to

%systemdrive%\install\Applications\, should now work fine :)

I just deleted the au3 files, when I made exe's of them, (thought I don't need them anymore :D), but ofcourse they needed editing! ;D

Thanks again MHz :thumbup

Link to comment
Share on other sites

In the Extras folder of autoit in the start menu there will be a folder called extras... there you can find a decompile command allowing you to change the .exe back to .au3.

Whenever I use autoit scripts I always put them in the same dir as the setup.exe and dont use a path. EX:

Run ( "Setup.exe" )

that way you wont run into this problem.

Link to comment
Share on other sites

In the Extras folder of autoit in the start menu there will be a folder called extras... there you can find a decompile command allowing you to change the .exe back to .au3.

Whenever I use autoit scripts I always put them in the same dir as the setup.exe and dont use a path. EX:

Run ( "Setup.exe" )

that way you wont run into this problem.

Thank you for the tip, Daedlus ;)

Link to comment
Share on other sites

Still got problems, I modified the script to Run("%systemdrive%\install\Applications\RegCleaner.exe")

But it seems that AutoIT wont regognize the %systemdrive%, because when i tryed this with Virtual, it popuped error when trying to find the exe from %systemdrive% not from C:\

Link to comment
Share on other sites

@Daedlus

Your relative addressing can fail as you show that you do not check the working directory and change it if needed. To ensure you concept will indeed work, check as the example below shows before using it.

If @WorkingDir <> @ScriptDir Then
FileChangeDir(@ScriptDir)
EndIf

Changing Working Directory within a script is a powerful thing to use, so I praise it's good use, but the script should always know it before relative use.

@oneless

Your in the system32 folder? Using a macro is a good idea also, though using @ScriptDir maybe better to use.

@Pete

I thought we covered this in the other topic? If your script is in the same directory as for example "RegCleaner.exe", then just do

Like Daedlus shows, but check Working Directory first

If @WorkingDir <> @ScriptDir Then
FileChangeDir(@ScriptDir)
EndIf

Run("RegCleaner.exe")

Or as oneless is refering to as in using an absolute address with a macro

Run(@ScriptDir & "\RegCleaner.exe")

Else, if you want to expand environmental variables in your string, then like this

Opt('ExpandEnvStrings', 1)

Run("%systemdrive%\install\Applications\RegCleaner.exe")

The top 2 methods are considered better IMHO, as you are not hardcoding the path. You can also expand variables or even use EnvGet() for getting envronmental variables, but you already have good choice to select from to get it right.

:)

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
  • Recently Browsing   0 members

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