# AutoIt3 Portable

## Recommended Posts

OP = Original Post(er)

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

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

Tutorials:
WebDriver - Wiki

• Replies 145
• Created

#### Popular Posts

I drew inspiration from a similar Script/Program Creator made, for designing a Portable version of the SciTE4AutoIt3 bundled with the AutoIt3 package. Note: The problem with the previous Script/Progr

When you've been banned your warn status will look like this... I've been banned like 2. And up until then, I'd also wonder why I had a warn status on my account. But then I noticed that it

Those files should work with the new version. Just give it time to do its thing. One thing do you have 7-Zip? You don't need it as I include 7z.exe but if there is a version on the system I use that

Thanks water!

My version works as you mentioned without the installed version. Is there a reason why you need to different version of AutoIt? I happy with V3.6.6.1!

Also in the Portable community the general rule of thumb is don't have a Portable and Installed version on the same machine as this can lead to problems.

Edited by guinness
##### Share on other sites

I like portable versions and there's no problem when no installed version exists.

I understand it's not a general problem, but sometimes you face it, though. For instance I take my AutoIt in a USB drive and if I need to change a program (or make a quick new one) it's very handy. But in case the target computer has an installed version I don't want to affect it or be affected by it.

Other possibility portables offer us is to test new versions of the program when you are currently using a previous one.

Well, don't worry, the problem is difficult to solve without modifying the wrapper and in the general case it works perfectly. I will live with that

##### Share on other sites

The source code for the Wrapper is available in the folder that the AutoIt3Wrapper.exe file is saved, so I might take a look at that this weekend and see what I can attempt at it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites

I believe I have corrected the issues with the AutoIt3Wrapper script so that it will run/check/compile a script from the same portable folder as SciTE is run from. As long as SciTE is started by using the script posted previously, this SHOULD run all of the tools from the correct folder.

The ZIP file contains the AutoIT3Wrapper script as well as the AU3Wrapper Icon so that you can build the executable for yourselves and can examine the source code to see that I haven't done anything fishy to it.

I haven't altered any of the code other than the places that it looks to find the location you've installed AutoIt3 and I've commented out the original code so that it is still there. You can always check it against the original wrapper source code, found in the AU3Wrapper folder under the SciTE folder. If there are any errors or I've missed a place where it starts the wrong program, please let me know.

PortableAutoIt3Wrapper.zip

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites

Fantastic!

It works perfectly!

Was it very difficult to dig in such a long script?

The problem with this approach is that it will have to be changed for every new version

I think it's the only solution though, if developers don't change it in the official version.

Thank you very much, I'm using it right now!

And now for autocompletion, I don't understand why it isn't working, it doesn't need Autoit, it's just a Scite issue.

It's autocompleting keywords, but not abbreviations.

##### Share on other sites

The process wasn't too hard. Mostly because the author of the wrapper code uses a consolewrite for every command that's executed that shows the path the program is running from. All I had to do was find where in the code that piece of text is, and then change the method he used to get the path to the tool so that it would point to the portable app folder. Mostly that meant commenting out a registry read and substituting that with an environment variable read.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites
• 1 month later...

Changelog

Added: $CmdLineRaw to pass dropped files to SciTE. Improved: FileSize of compiled application. Updated original post. Thanks. Edited by guinness ##### Link to post ##### Share on other sites • 1 month later... Changelog Improved: Source code & removed bug introduced in update of code. Improved: FileSize of compiled application. Updated original post. Thanks. Edited by guinness ##### Link to post ##### Share on other sites the "WARNING: If you also have an installed version too, then Obfuscator & Tidy will be used from the local machine and not the Portable version." is fixed, I made a patch for the source code (Original or Mod.), you compile it. ..and works with beta versions too. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: argumentum #ce ---------------------------------------------------------------------------- If Not FileExists("AutoIt3Wrapper.au3") Then Exit MsgBox(0,@ScriptName,'"AutoIt3Wrapper.au3" not found')$s = FileRead("AutoIt3Wrapper.au3")
$a = StringSplit($s,@CRLF,1)
$sPatchDate = '2011.07.28' For$x = 1 To UBound($a) -3 If StringInStr($a[$x],'#AutoIt3Wrapper_Run_After=') Then$a[$x] = ';~'&@TAB&$a[$x] If StringInStr($a[$x],'#AutoIt3Wrapper_Res_Field=Credits|') Then$a[$x] =$a[$x] &@CRLF& '#AutoIt3Wrapper_Res_Field=Patch Date|argumentum '&$sPatchDate

If $a[$x] = 'Global $VERSION = FileGetVersion(@ScriptFullPath)' Then If$a[$x+1] = 'Global$sPortableAutoitDir = ""' Then
Exit MsgBox(0,@ScriptName,"Previously patched")
Else
$a[$x] = $a[$x] &@CRLF& 'Global $sPortableAutoitDir = ""' &@CRLF& _ 'If FileExists(@ScriptDir & "\..\..\..\App\SciTE\SciTE.exe") Then$sPortableAutoitDir = StringLeft(@ScriptDir, StringInStr(@ScriptDir, "\", 0, -2) - 1)'
EndIf
EndIf

If '#EndRegion Declare variables' = $a[$x+1] Then
$a[$x] = $a[$x] &@CRLF& _
'If $sPortableAutoitDir <> "" Then$CurrentAutoIt_InstallDir = $sPortableAutoitDir' &@CRLF& _ 'If$sPortableAutoitDir <> "" Then $SciTE_Dir =$sPortableAutoitDir & "\SciTE"'
EndIf

If StringInStr($a[$x-1],'$CurrentAutoIt_InstallDir =$INP_AutoitDir') Then
$a[$x] = $a[$x] &@CRLF& _
TabNice($a[$x])&'If $sPortableAutoitDir <> "" Then$CurrentAutoIt_InstallDir = $sPortableAutoitDir' EndIf If StringInStr($a[$x],'$INP_AutoitDir = $CMDLINE[$x]') Then
$a[$x] = $a[$x] &@CRLF& _
TabNice($a[$x])&'If $sPortableAutoitDir <> "" Then$INP_AutoitDir = $sPortableAutoitDir' EndIf If StringInStr($a[$x],'$INP_AutoitDir = @ProgramFilesDir & "\AutoIt3"') Then
$a[$x] = $a[$x] &@CRLF& _
TabNice($a[$x])&'If $sPortableAutoitDir <> "" Then$INP_AutoitDir = $sPortableAutoitDir' EndIf If StringInStr($a[$x],"$INP_AutoitDir = RegRead($RegistryLM, 'InstallDir')") Then$a[$x] =$a[$x] &@CRLF& _ TabNice($a[$x])&'If$sPortableAutoitDir <> "" Then $INP_AutoitDir =$sPortableAutoitDir'
EndIf

If StringInStr($a[$x],"$INP_AutoitDir = RegRead($RegistryLM, 'BetaInstallDir')") Then
$a[$x] = $a[$x] &@CRLF& _
TabNice($a[$x])&'If $sPortableAutoitDir <> "" Then$INP_AutoitDir = $sPortableAutoitDir & "\beta" ; ForPortableBetaPatch' EndIf If StringInStr($a[$x],'$INP_AutoitDir = @ProgramFilesDir & "\AutoIt3\Beta"') Then
$a[$x] = $a[$x] &@CRLF& _
TabNice($a[$x])&'If $sPortableAutoitDir <> "" Then$INP_AutoitDir = $sPortableAutoitDir & "\beta" ; ForPortableBetaPatch' EndIf If StringInStr($a[$x],'GUICtrlCreateLabel("Source:", 30, 105, 65, 20,$SS_RIGHT)') Then
$a[$x-1] = $a[$x-1]  &@CRLF& _
TabNice($a[$x])&'If Not FileExists($CurrentAutoIt_InstallDir & "\Beta\aut2exe\AutoitSC.bin") Then ; ForPortableBetaPatch'&@CRLF& _ TabNice($a[$x])&@TAB&'GUICtrlSetState($H_AUTOIT3_Version_P, $GUI_CHECKED)'&@CRLF& _ TabNice($a[$x])&@TAB&'GUICtrlSetState($H_AUTOIT3_Version_B, $GUI_DISABLE)'&@CRLF& _ TabNice($a[$x])&'EndIf' EndIf ; change title to reflect when mode of operation is portable If StringInStr($a[$x],'Func GUI_Show()') Then$a[$x] =$a[$x] &@CRLF& _ @TAB&'Local$sTitleGUI = "AutoIt3Wrapper GUI to Compile AutotIt3 Script (ver " & $VERSION & ")"' &@CRLF& _ @TAB&'If$sPortableAutoitDir <> "" Then $sTitleGUI &= " [Portable Mode]"' EndIf If StringInStr($a[$x],'"AutoIt3Wrapper GUI to Compile AutotIt3 Script (ver " &$VERSION & ")"') And Not StringInStr($a[$x],'$sTitleGUI') Then$a[$x] = StringReplace($a[$x],'"AutoIt3Wrapper GUI to Compile AutotIt3 Script (ver " &$VERSION & ")"','$sTitleGUI') EndIf Next$s = ""
For $x = 1 To UBound($a) -1
$s &=$a[$x] & @CRLF Next FileMove('AutoIt3Wrapper.au3','AutoIt3Wrapper.Before '&$sPatchDate&' Patch.au3')
If FileExists('AutoIt3Wrapper.au3') Then FileDelete('AutoIt3Wrapper.au3')
FileWrite('AutoIt3Wrapper.au3',$s) MsgBox(0,@ScriptName,"FilePatched, now you compile it."&@CRLF&"..remember to update the FileVersion") Func TabNice($1)
Local $sReturn = "" While StringLeft($1,1) = @TAB
$1 = StringTrimLeft($1,1)
$sReturn &= @TAB WEnd Return$sReturn
EndFunc

Edit: added: safety code if no beta available

Edit: added: change title to show when running in portable mode

Edited by argumentum
##### Share on other sites

Uploaded a new version of AutoIt Portable, please check the initial post & this time around the source code is available!

Edited by guinness
##### Share on other sites

WARNING: If you also have an installed version too, then Obfuscator & Tidy will be used from the local machine and not the Portable version.

Have a look at this by BrewManNH to get an idea of how to overcome 50% of the problem.

the patch I made for AutoIt3Wrapper works just fine. Tidy works as expected from the portable and from within the editor. Let me know if that is not so for you.

Here is the spanish translaton:

[Language]
CLEANUP=Limpiar
CLOSE=Cerrar
EMPTY=Vaciar carpeta
EXIT=Salir
LANGUAGE=Lenguage
TIP_CREATOR_1=Bienvenido a %PROGRAMNAME%.
TIP_CREATOR_2=Creando AutoIt Portatil ...
TIP_MAIN_1=No se pudo cargar SciTE.exe.
TIP_MAIN_2=Parece que %PROGRAMNAME% no pudo cargar %PROPERTIESFILE%
TIP_MAIN_3=Favor de esperar ...
TIP_MAIN_4=No mostrar de nuevo
TIP_MAIN_5=Con un solo clic
TIP_MAIN_6=Ejemplos en AutoIt

[Author]
AUTHOR=softwarespot
VERSION=1.0.0.2
UPDATED=02/08/2011

[Country]
CODE=es

..also the resources.au3 is not included in the distribution.

Edit: changed: TIP_MAIN_4 was wrong ( also, just in case you need it, spanish is written as "Español" in spanish )

Edited by argumentum
##### Share on other sites

Thanks for the translation & I haven't found a problem with your code yet

About the Resources.au3, I haven't included it because I figured that those who would look at the source code would have a pretty good understanding of how to use AutoIt & I personally don't feel it's fair that I re-distribute another persons work, hence why the images aren't imcluded in the source.zip as well. Another reason is I don't know if Zedna would be happy that I released his code under GPLv3!

##### Share on other sites

the patch I made for AutoIt3Wrapper works just fine. Tidy works as expected from the portable and from within the editor. Let me know if that is not so for you.

The version I posted works just as easily and has the Wrapper compiled as well, so not sure why there was a need for 2.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites

The version I posted works just as easily and has the Wrapper compiled as well, so not sure why there was a need for 2.

I now use the portable version my self on a virtual PC, where I develped a program for a client over year ago and wanted to use a newer version of Autoit while keeping the old as was.

At the time I did not know that your version worked and after reading that "Obfuscator & Tidy will be used from the local machine and not the Portable version", I decided to give it a try myself and made a patch that would work with other versions of the wrapper.

Never meant to rewrite something functional.

##### Share on other sites
• 1 month later...

I got it working but i have two questions.

1: After installing, do i need anything other than the app folder?

2: Is there a way to set SciTE's user include file dir without admin privileges?

Edited by wIck3d
##### Share on other sites

Unfortunately the User's include folder is a registry setting, so if you set it on the computer that you're running the portable version from and that computer has AutoIt installed you will mess up the setting on that computer. If you have your own includes, or ones that aren't natively included with AutoIt's install, you should probably put those in the App\Include folder instead of a separate one.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites
• 1 month later...

I've just uploaded a small addition but without changing the version number. The addition is now the file abbrev.properties is copied to the correct location from the properties folder, therefore you can now use Abbreviations within AutoIt Portable.

##### Share on other sites

That's it!

So the portable version didn't find Abbreviations file in its correct folder. Cool you found the problem (and the solution!)

Thanks guinness!

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...