Jump to content

AutoIt3 Portable Edition


Creator
 Share

Recommended Posts

I did a little tweaking and made it behave just like a PortableApp's application.

Launcher:

#include <File.au3>
#Include <WindowsConstants.au3>
Dim $arProps
$hGUI = GUICreate("Splash", 416, 249, -1, -1, $WS_POPUP)
$hPic = GUICtrlCreatePic("./Autoit3Portable.jpg", 0, 0, 416, 249)
WinSetTrans($hGUI, "", 1)
GUISetState()
For $j = 1 to 255 Step +15
    WinSetTrans($hGUI, "", $j)
Next
Sleep(3000)
_FileReadToArray(@ScriptDir & "\App\Scite\properties\au3.properties",$arProps)
For $i=1 To $arProps[0]
    If StringUpper(StringLeft(StringStripWS($arProps[$i],1), 11)) = 'AUTOIT3DIR=' Then
        $arProps[$i] = 'autoit3dir=' & @ScriptDir & '\App'
    EndIf
Next

_FileWriteFromArray(@ScriptDir & "\App\Scite\properties\au3.properties",$arProps, 1)

Run(@ScriptDir & "\App\Scite\Scite.exe", @ScriptDir & "\App\Scite")

And the Splashscreen:

Posted Image

Behold my Photoshop prowess! (Ok, I made it in The Gimp >< )

EDIT: I know, I screwed up the bottom bar muttley

Edited by KentonBomb
Link to comment
Share on other sites

  • Replies 70
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I've been using AutoIt in a stick for a while now, and I use a different method.

According to the SciTE documentation, the value of the variable SciteDefaultHome is "directory in which the Global Options file is found".

This is how I set up my au3.properties file:

CODE

# SciTE settings for AutoIt v3

#

# July 2007 - Jos van der Zande (jdeb (at) autoitscript (dot) com)

#

#

# *** Specify here your AutoIt program directory ***

autoit3dir=$(SciteDefaultHome)\..

file.patterns.au3=*.au3

filter.au3=AutoIt (au3)|$(file.patterns.au3)|

lexer.$(file.patterns.au3)=au3

#define the number of backup files you want to keep 0=none

backup.files=0

#define if you want AutoIt3Wrapper to check once every day for available updates for SciTE4AutoIt3

check.updates.scite4autoit3=0

#define the activation of the ProperCase function using au3.api. 0=no change, 1=Propercase functions and keywordse

proper.case=0

#Modify Context Menu to add Right Click, Add as Snippet

user.context.menu=||Add as Snippet|1116|

## Debug Output Options (to permanent change your selection copy them to SciTEUser.Properties and change it there

# Debug MessageBox Option 2="All" 1="No @extended" 0="No @extended & @error".

debug.msgbox.option=1

# Debug Console Option 3="All" 2="No SystemTime" 1="No SystemTime & Return" 0="No SystemTime, Return & Error".

debug.console.option=1

# Debug Trace Option 3="All" 2="No SystemTime" 1="No SystemTime & Return" 0="No SystemTime, Return & Error".

debug.trace.option=1

##

# Commands to compile / run your script

command.go.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "$(FilePath)" /autoit3dir "$(autoit3dir)" /UserParams $(1) $(2) $(3) $(4)

;command.go.$(file.patterns.au3)="$(autoit3dir)\autoit3.exe" /ErrorStdOut "$(FilePath)" $(1) $(2) $(3) $(4)

command.go.subsystem.$(file.patterns.au3)=1

command.compile.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "$(FilePath)"

command.compile.filter.$(file.patterns.au3)=1

command.build.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "$(FilePath)" /autoit3dir "$(autoit3dir)"

command.build.filter.$(file.patterns.au3)=1

#~ #command.build.$(file.patterns.au3)="$(autoit3dir)\aut2exe\aut2exe.exe" /in "$(FilePath)"

# 00 Beta RUN

;command.0.$(file.patterns.au3)=$(autoit3dir)\beta\autoit3.exe /ErrorStdOut "$(FilePath)"

command.0.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "$(FilePath)" /autoit3dir "$(autoit3dir)\beta" /UserParams $(1) $(2) $(3) $(4)

command.name.0.$(file.patterns.au3)=Beta Run

command.save.before.0.$(file.patterns.au3)=1

command.shortcut.0.$(file.patterns.au3)=Alt+F5

# 01 Beta AUT2EXE

command.1.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /beta /in "$(FilePath)" /autoit3dir "$(autoit3dir)\beta"

command.name.1.$(file.patterns.au3)=Beta Compile

command.save.before.1.$(file.patterns.au3)=1

command.shortcut.1.$(file.patterns.au3)=Alt+F7

command.is.filter.1.$(file.patterns.au3)=1

# 02 Beta Helpfile

command.2.$(file.patterns.au3)=$(autoit3dir)\beta\Autoit3Help.exe $(CurrentWord)

;command.2.$(file.patterns.au3)=$(autoit3dir)\beta\Autoit3Help.exe "$(CurrentWord)"

;$(CurrentWord)!$(autoit4dir)\beta\autoitbeta.chm

command.name.2.$(file.patterns.au3)=Beta Help

command.subsystem.2.$(file.patterns.au3)=2

command.shortcut.2.$(file.patterns.au3)=Alt+F1

command.save.before.2.$(file.patterns.au3)=2

# 03 Tylo's au3check program for Prod

command.3.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "$(FilePath)"

;command.3.$(file.patterns.au3)="$(SciteDefaultHome)\au3check\au3check" "$(FilePath)"

command.name.3.$(file.patterns.au3)=SyntaxCheck Prod

command.shortcut.3.$(file.patterns.au3)=Ctrl+F5

command.save.before.3.$(file.patterns.au3)=1

# 04 Tylo's au3check program for Beta

command.4.$(file.patterns.au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /beta /AU3Check /in "$(FilePath)"

;command.4.$(file.patterns.au3)="$(SciteDefaultHome)\au3check\au3check" "$(FilePath)"

command.name.4.$(file.patterns.au3)=SyntaxCheck Beta

command.shortcut.4.$(file.patterns.au3)=Ctrl+Alt+F5

command.save.before.4.$(file.patterns.au3)=1

#

# 05 JdeB's AutoIt FunctionPopup

command.5.$(file.patterns.au3)="$(SciteDefaultHome)\FuncPopUp\FuncPopUp.exe" "-h:$(WindowID)"

command.subsystem.5.$(file.patterns.au3)=2

command.name.5.$(file.patterns.au3)=FunctionPopUp

command.shortcut.5.$(file.patterns.au3)=Shift+F1

command.save.before.5.$(file.patterns.au3)=2

# 06 Larry's AU3Info program

command.6.$(file.patterns.au3)="$(autoit3dir)\AU3Info.exe"

command.name.6.$(file.patterns.au3)=AU3Info

command.shortcut.6.$(file.patterns.au3)=Ctrl+F6

command.subsystem.6.$(file.patterns.au3)=2

command.save.before.6.$(file.patterns.au3)=2

command.replace.selection.6.$(file.patterns.au3)=0

command.quiet.6.$(file.patterns.au3)=1

# 07 Larry's AU3Record program

command.7.$(file.patterns.au3)="$(SciteDefaultHome)\ScriptWriter\AU3record.exe" /o

command.subsystem.7.$(file.patterns.au3)=1

command.name.7.$(file.patterns.au3)=AU3Recorder

command.shortcut.7.$(file.patterns.au3)=Alt+F6

command.save.before.7.$(file.patterns.au3)=2

command.replace.selection.7.$(file.patterns.au3)=1

command.quiet.7.$(file.patterns.au3)=1

# 08 VoSs2o0o's AutoItMacroGenerator

command.8.$(file.patterns.au3)="$(SciteDefaultHome)\AutoItMacroGenerator\AutoItMacroGenerator02.exe" /Scite

command.subsystem.8.$(file.patterns.au3)=1

command.name.8.$(file.patterns.au3)=AutoitMacroGenerator

command.shortcut.8.$(file.patterns.au3)=Alt+A

command.save.before.8.$(file.patterns.au3)=2

command.replace.selection.8.$(file.patterns.au3)=1

command.quiet.8.$(file.patterns.au3)=1

# 09 JdeB's Tidy formatting program for Autoit3

command.9.$(file.patterns.au3)="$(SciteDefaultHome)\tidy\tidy.exe" "$(FilePath)"

command.name.9.$(file.patterns.au3)=Tidy AutoIt Source

command.subsystem.9.$(file.patterns.au3)=0

command.save.before.9.$(file.patterns.au3)=1

command.shortcut.9.$(file.patterns.au3)=Ctrl+T

command.is.filter.9.$(file.patterns.au3)=1

# 10 Giuseppe's CodeWizard program

command.10.$(file.patterns.au3)="$(SciteDefaultHome)\CodeWizard\CodeWizard.exe" /StdOut

command.subsystem.10.$(file.patterns.au3)=1

command.name.10.$(file.patterns.au3)=CodeWizard

command.shortcut.10.$(file.patterns.au3)=Alt+W

command.save.before.10.$(file.patterns.au3)=2

command.replace.selection.10.$(file.patterns.au3)=1

command.quiet.10.$(file.patterns.au3)=1

# 11

#~ command.11.$(file.patterns.au3)="$(SciteDefaultHome)\GuiBuilder\GuiBuilder.exe" /StdOut

#~ command.subsystem.11.$(file.patterns.au3)=1

#~ command.name.11.$(file.patterns.au3)=GuiBuilder

#~ command.shortcut.11.$(file.patterns.au3)=Alt+G

#~ command.save.before.11.$(file.patterns.au3)=2

#~ command.replace.selection.11.$(file.patterns.au3)=1

#~ command.quiet.11.$(file.patterns.au3)=1

# 12 lookfar's Koda FormDesigner

command.12.$(file.patterns.au3)="$(SciteDefaultHome)\Koda\FD.exe" /Scite

command.subsystem.12.$(file.patterns.au3)=1

command.name.12.$(file.patterns.au3)=Koda(FormDesigner)

command.shortcut.12.$(file.patterns.au3)=Alt+m

command.save.before.12.$(file.patterns.au3)=2

command.replace.selection.12.$(file.patterns.au3)=1

command.quiet.12.$(file.patterns.au3)=1

# 14 JdeB's SciTeConfig

command.14.$(file.patterns.au3)="$(SciteDefaultHome)\SciteConfig.exe"

command.name.14.$(file.patterns.au3)=SciTe Config

command.shortcut.14.$(file.patterns.au3)=Ctrl+1

command.subsystem.14.$(file.patterns.au3)=2

command.save.before.14.$(file.patterns.au3)=2

command.replace.selection.14.$(file.patterns.au3)=0

command.quiet.14.$(file.patterns.au3)=1

# 15 MHz User Calltips

command.15.*=$(SciteDefaultHome)\scite.exe "$(SciteDefaultHome)\api\au3.user.calltips.api"

command.subsystem.15.*=1

command.name.15.*=User CallTip Entries

# 16 GAfrost Snippet holder

command.16.$(file.patterns.au3)="$(SciteDefaultHome)\CSnippet\CSnippet.exe" /CreateSnippet

command.name.16.$(file.patterns.au3)=Snippet Holder

command.shortcut.16.$(file.patterns.au3)=Ctrl+Alt+s

command.subsystem.16.$(file.patterns.au3)=2

command.save.before.16.$(file.patterns.au3)=2

command.replace.selection.16.$(file.patterns.au3)=0

command.quiet.16.$(file.patterns.au3)=1

# Standard LUA Functions

extension.$(file.patterns.au3)=$(SciteDefaultHome)\AutoIt3.lua

#

# 19 Jump function quickly

command.name.19.$(file.patterns.au3)=Jump to Function Prod

command.mode.19.$(file.patterns.au3)=subsystem:lua,savebefore:no

command.shortcut.19.$(file.patterns.au3)=Ctrl+J

command.19.$(file.patterns.au3)=GotoDefinition

# 20 Jump Beta function quickly

command.name.20.$(file.patterns.au3)=Jump to Function Beta

command.mode.20.$(file.patterns.au3)=subsystem:lua,savebefore:no

command.shortcut.20.$(file.patterns.au3)=Ctrl+Alt+J

command.20.$(file.patterns.au3)=GotoDefinition beta

# 21 List functions

command.name.21.$(file.patterns.au3)=List Functions

command.21.$(file.patterns.au3)=List_Functions

command.subsystem.21.$(file.patterns.au3)=3

command.mode.21.$(file.patterns.au3)=savebefore:no

command.shortcut.21.$(file.patterns.au3)=Alt+L

# 22 Replacement toggle LUA script for MONOSPACE font

command.name.22.$(file.patterns.au3)=Toggle Override Font

command.mode.22.$(file.patterns.au3)=subsystem:lua,savebefore:no

command.shortcut.22.$(file.patterns.au3)=Ctrl+F11

command.22.$(file.patterns.au3)=toggleOverrideFont

# 23 Copy all bookmarked lines to current line

command.name.23.$(file.patterns.au3)=Insert Bookmarked Line(s)

command.subsystem.23.$(file.patterns.au3)=3

command.23.$(file.patterns.au3)=Copy_BookMarks

command.shortcut.23.$(file.patterns.au3)=Ctrl+Alt+B

command.save.before.23.$(file.patterns.au3)=2

# 24 Add a msgbox for debugging

command.name.24.$(file.patterns.au3)=Debug to MsgBox

command.subsystem.24.$(file.patterns.au3)=3

command.24.$(file.patterns.au3)=Debug_MsgBox

command.shortcut.24.$(file.patterns.au3)=Ctrl+Shift+D

command.save.before.24.$(file.patterns.au3)=2

# 25 Add a Console msg for debugging

command.name.25.$(file.patterns.au3)=Debug to Console

command.subsystem.25.$(file.patterns.au3)=3

command.25.$(file.patterns.au3)=Debug_Console

command.shortcut.25.$(file.patterns.au3)=Alt+D

command.save.before.25.$(file.patterns.au3)=2

# 26 Remove Console and MSGBOX debug lines

command.name.26.$(file.patterns.au3)=Debug Remove lines

command.subsystem.26.$(file.patterns.au3)=3

command.26.$(file.patterns.au3)=Remove_Debug

command.shortcut.26.$(file.patterns.au3)=Ctrl+Alt+Z

command.save.before.26.$(file.patterns.au3)=2

# 27 Add ConsoleWrite Trace lines

command.name.27.$(file.patterns.au3)=Trace: Add Trace Lines

command.subsystem.27.$(file.patterns.au3)=3

command.27.$(file.patterns.au3)=TraceAdd

command.shortcut.27.$(file.patterns.au3)=

command.save.before.27.$(file.patterns.au3)=2

# 28 Add ConsoleWrite Function Trace lines

command.name.28.$(file.patterns.au3)=Trace: Add Func Trace Lines

command.subsystem.28.$(file.patterns.au3)=3

command.28.$(file.patterns.au3)=FunctionTraceAdd

command.shortcut.28.$(file.patterns.au3)=

command.save.before.28.$(file.patterns.au3)=2

# 29 Remove Trace Console lines

command.name.29.$(file.patterns.au3)=Trace: Remove ALL Trace lines

command.subsystem.29.$(file.patterns.au3)=3

command.29.$(file.patterns.au3)=TraceRemoveAll

command.shortcut.29.$(file.patterns.au3)=

command.save.before.29.$(file.patterns.au3)=2

# 30 Comment Console and MSGBOX debug lines

command.name.30.$(file.patterns.au3)=DebugTrace: Comment ALL lines

command.subsystem.30.$(file.patterns.au3)=3

command.30.$(file.patterns.au3)=CommentAllDebug

command.shortcut.30.$(file.patterns.au3)=Alt+Shift+D

command.save.before.30.$(file.patterns.au3)=2

# 31 UnComment Console and MSGBOX debug lines

command.name.31.$(file.patterns.au3)=DebugTrace: UnComment ALL lines

command.subsystem.31.$(file.patterns.au3)=3

command.31.$(file.patterns.au3)=unCommentAllDebug

command.shortcut.31.$(file.patterns.au3)=Alt+Ctrl+D

command.save.before.31.$(file.patterns.au3)=2

# 32 Clean up script by resetting indents and removing trailing spaces

command.name.32.$(file.patterns.au3)=Cleanup Script WhiteSpace

command.subsystem.32.$(file.patterns.au3)=3

command.32.$(file.patterns.au3)=cleanDocWhitespace

command.shortcut.32.$(file.patterns.au3)=

command.save.before.32.$(file.patterns.au3)=2

# 33 Open #include File

command.name.33.$(file.patterns.au3)=OpenInclude

command.mode.33.$(file.patterns.au3)=subsystem:lua,savebefore:no

command.shortcut.33.$(file.patterns.au3)=Alt+I

command.33.$(file.patterns.au3)=OpenInclude

# 34 Open BETA #include File

command.name.34.$(file.patterns.au3)=OpenInclude_Beta

command.mode.34.$(file.patterns.au3)=subsystem:lua,savebefore:no

command.shortcut.34.$(file.patterns.au3)=Alt+Shift+I

command.34.$(file.patterns.au3)=OpenInclude beta

# Commands to for Help F1

#~ command.help.$(file.patterns.au3)=$(CurrentWord)!$(autoit3dir)\autoit.chm

#~ command.help.subsystem.$(file.patterns.au3)=4

command.help.$(file.patterns.au3)=$(autoit3dir)\Autoit3Help.exe $(CurrentWord)

;command.help.$(file.patterns.au3)=$(autoit3dir)\Autoit3Help.exe "$(CurrentWord)"

command.help.subsystem.$(file.patterns.au3)=2

# Autocomplete and call tip settings

api.$(file.patterns.au3)=$(SciteDefaultHome)\api\au3.api;$(SciteDefaultHome)\api\au3.user.calltips.api;$(SciteDefaultHome)\api\au3.Auto3lib.calltips.api

calltip.au3.word.characters=$(chars.alpha)$(chars.numeric)_

calltip.au3.ignorecase=1

calltip.au3.end.definition=)

autocomplete.au3.ignorecase=1

autocomplete.au3.start.characters=$(chars.alpha)$(chars.numeric)$_@#

word.characters.$(file.patterns.au3)=$(chars.alpha)$(chars.numeric)$(chars.accented).$_@#

# Auto indent stuff

#~ indent.size.$(file.patterns.au3)=4

statement.indent.$(file.patterns.au3)=

statement.end.$(file.patterns.au3)=

statement.lookback.$(file.patterns.au3)=

block.start.$(file.patterns.au3)=5 case if do for func else elseif while select switch with\

Case If Do For Func Else ElseIf While Select Switch With\

CASE IF DO FOR FUNC ELSE ELSEIF WHILE SELECT SWITCH WITH

block.end.$(file.patterns.au3)=5 case else endif elseif endfunc endselect endswitch next until wend endwith\

Case Else EndIf ElseIf EndFunc EndSelect EndSwitch Next Until Wend WEnd EndWith\

CASE ELSE ENDIF ELSEIF ENDFUNC ENDSELECT ENDSWITCH NEXT UNTIL WEND ENDWITH

# Comments functions definition

comment.block.au3=;~

comment.block.at.line.start.au3=1

comment.stream.start.au3=#CS

comment.stream.end.au3=#CE

comment.box.start.au3=#CS

comment.box.middle.au3=

comment.box.end.au3=#CE

# Import the seperate au3.keywords.properties file containing AutoIt3 info (based on script by Valik)

import au3.keywords

# Import the seperate au3.keywords.Abbreviations.properties file containing Abbreviation keywords supplied by Mhz

import au3.keywords.abbreviations

# Autoit keywords

keywords.$(file.patterns.au3)=$(au3.keywords.keywords)

# Autoit functions

keywords2.$(file.patterns.au3)=$(au3.keywords.functions)

# Autoit macros

keywords3.$(file.patterns.au3)=$(au3.keywords.macros)

# Autoit Send Keys

keywords4.$(file.patterns.au3)=$(au3.keywords.sendkeys)

# Pre-Processor

keywords5.$(file.patterns.au3)=$(au3.keywords.preprocessor)

# Special

keywords6.$(file.patterns.au3)=$(au3.keywords.special)

# Expand abbreviations

keywords7.$(file.patterns.au3)=$(au3.keywords.abbrev)

# UDFS

keywords8.$(file.patterns.au3)=$(au3.keywords.udfs)

# White space

style.au3.0=fore:#000000

# Comment line

style.au3.1=fore:#009933,italics

# Comment block

style.au3.2=fore:#669900,italics

# Number

style.au3.3=fore:#AC00A9,bold,italics

# Function

style.au3.4=fore:#000090,bold,italics

# Keyword

style.au3.5=fore:#0000FF,bold

# Macro

style.au3.6=fore:#FF33FF,bold

# String

style.au3.7=fore:#9999CC,bold

# Operator

style.au3.8=fore:#FF0000,bold

# Variable

style.au3.9=fore:#AA0000,bold

# Sent keys in string

style.au3.10=fore:#FF8800,bold

# Pre-Processor

style.au3.11=fore:#F000FF,italics

# Special

style.au3.12=fore:#A00FF0,italics

# Expand abbreviations

style.au3.13=fore:#FF0000,bold

# ComObjects

style.au3.14=fore:#0000FF,bold,italics

#Standard UDF's

style.au3.15=fore:#0080FF,italics,bold

It's not a quite recent version, but I think it'll work on the newer versions of AutoIt.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

I've also been using it on a thumbdrive for a while with some help from folks in the Scite development topic I believe.

My one and only tweak to au3.properties was very similar to the post above:

autoit3dir=..\AutoIt3

The only issues I've seen are that when running my "portable" scite on my home computer, it uses the settings and such from the home computer... so basically, I'm running I:\AutoIt3\Scite\Scite.exe, but it thinks I'm running C:\Program Files\AutoIt3\Scite\Scite.exe.

Also, when I compile or build an exe from an au3, it usually can't find the UPX compression software, so I uncheck the "compress with upx" option when I'm using "portable" autoit.

Also, Scite's "help" button doesn't open AutoIt Help, but that's ok (see below)

I did make some nifty launcher icons for my Portable Apps menu:

AutoIt Help Files:

FileChangeDir (@ScriptDir & "\AutoIt")
Run("AutoIt3Help.exe",@WorkingDir)

Scite Editor:

FileChangeDir (@ScriptDir & "\AutoIt\SciTe")
Run("SciTE.exe",@WorkingDir)

Open "Scripts" folder:

$ScriptDrive = StringLeft(@ScriptDir,StringInStr(@ScriptDir,":\")-1)
Run("explorer.exe " & $ScriptDrive & ":\PortableApps\AutoIt3\Scripts")
Edited by psonar
Link to comment
Share on other sites

Here's a version of UpdateDefs for your portable version, cleverly named UpdateDefs_portable.exe. It assumes the default installation paths, and that the SciTE_HOME environment variable points to the SciTE directory (mentioned above, and should be handled by a launcher of some sort). Someone be kind enough to make sure I didn't goof anything. I tested it and it updated my portable HDD correctly.

#RequireAdmin
#NoTrayIcon
#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=Script to update the SciTe installation with the correct definitions
#AutoIt3Wrapper_Res_Description=Update the SciTe definitions files
#AutoIt3Wrapper_Res_Fileversion=1.4.3.5
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=Copyright © 2008 Jos van der Zande
#AutoIt3Wrapper_Res_Field=Created By|Jos van der Zande
#AutoIt3Wrapper_Res_Field=Email|jdeb@autoscript.com
#AutoIt3Wrapper_cvsWrapper_Parameters=/comments "%fileversion% \n"
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
$Debug = 1
Opt("TrayIconDebug", 1)
$PRODUNCTIONTEXT = IniRead(@ScriptDir & "\versioninfo.ini", "Version", "Production", "Production definitions")
$BetaTEXT = "Beta:" & IniRead(@ScriptDir & "\versioninfo.ini", "Version", "Beta", "Beta definitions")
Global $Version = FileGetVersion(@ScriptFullPath)
$Version = StringLeft($Version, StringInStr($Version, ".", 0, -2) - 1)
; get new registry settings for AutoIt3 location
$AutoItDir = @ScriptDir & "\..\.."
If $Debug = 1 Then FileWriteLine(@ScriptDir & "\updateDefs.log", "3. $AutoItDir=" & $AutoItDir)
; get new registry settings for AutoIt3 location
$AutoItDirBeta = @ScriptDir & "\..\..\Beta"
If $Debug = 1 Then FileWriteLine(@ScriptDir & "\updateDefs.log", "3. $AutoItDirBeta=" & $AutoItDirBeta)
Dim $I_PRODUCTION, $SELECTION
Global $Silent = 0
For $x = 1 To $CMDLINE[0]
    If StringLeft($CMDLINE[$x], 4) = "Prod" Then $SELECTION = "Production"
    If StringLeft($CMDLINE[$x], 4) = "Unst" Then $SELECTION = "Beta"
    If StringLeft($CMDLINE[$x], 4) = "Beta" Then $SELECTION = "Beta"
    If StringLeft($CMDLINE[$x], 6) = "Latest" Then $SELECTION = "Latest"
    If $CMDLINE[$x] = "/S" Then $Silent = 1
Next
FileDelete(@ScriptDir & "\updateDefs.log")
If $SELECTION = "" Then
    Opt("guicoordmode", 1)
;Opt("GUINotifyMode", 1)
    GUICreate("SciTe definition selection (" & $Version & ")", 350, 150)
    GUISetFont(10, 600)
    GUICtrlCreateLabel("Select which definitions you want to use for: Scite,Tidy,FuncPopUp.", 10, 10, 340, 40)
    GUISetFont(9, 400)
    Global $I_PRODUCTION = GUICtrlCreateRadio($PRODUNCTIONTEXT, 40, 50, 270, 20)
    Global $I_Beta = GUICtrlCreateRadio($BetaTEXT, 40, 75, 270, 20)
    Global $I_OK = GUICtrlCreateButton("&Update", 40, 110, 120, 25)
    Global $I_CANCEL = GUICtrlCreateButton("&Cancel", 170, 110, 120, 25)
;
    GUICtrlSetState($I_PRODUCTION, 1)
    GUISetState(@SW_SHOW)
    While 1
        $RC = GUIGetMsg()
; Cancel clicked
        If $RC = 0 Then ContinueLoop
        If $RC = $I_OK Then ExitLoop
        If $RC = $I_CANCEL Then
            $RC = MsgBox(4100, "Update SciTE Definitions", "do you want to stop this update process?")
            If $RC = 6 Then Exit
        EndIf
        If $RC = -3 Then Exit
    WEnd
EndIf
;
If $SELECTION = "Latest" then
    If Not FileExists($AutoItDirBeta & "\autoit3.exe") Then
        $SELECTION = "Production"
    Else
        $ProdVer = StringSplit(FileGetVersion($AutoItDir & "\autoit3.exe"),".")
        $BetaVer = StringSplit(FileGetVersion($AutoItDirBeta & "\autoit3.exe"),".")
        ReDim $ProdVer[5], $BetaVer[5]
        For $x = 1 to 4
            If $ProdVer[$x] = $BetaVer[$x] then ContinueLoop
            If $ProdVer[$x] > $BetaVer[$x] then 
                $SELECTION = "Production"
            Else
                $SELECTION = "Beta"
            EndIf
            ExitLoop
        Next    
    EndIf
EndIf
;
$msgtext = @LF & @LF & "Run program " & @ScriptFullPath & " again when you want to change the definition files."
$SciteDir = StringLeft(@ScriptDir, StringInStr(@ScriptDir, "\", 0, -1) - 1)
GUISetState(@SW_HIDE)
If $Silent = 0 Then ProgressOn("Scite Config files", "Copying Files")
FileChangeDir(@ScriptDir)
If $Silent = 0 Then ProgressSet(30, "Update au3.properties")
If $Debug = 1 Then FileWriteLine(@ScriptDir & "\updateDefs.log", "$SciteDir=" & $SciteDir)
Update_Autoit_Path($SciteDir)
Sleep(500)
If GUICtrlRead($I_PRODUCTION) = 1 Or $SELECTION = "Production" Then
    If $Silent = 0 Then ProgressSet(50, "Copying files version:" & $PRODUNCTIONTEXT)
    CopyFiles(@ScriptDir & '\Production', $SciteDir)
    UpdateAbbr(@ScriptDir & '\Production\au3abbrev.properties')
    Sleep(500)
    If $Silent = 0 Then ProgressOff()
    If $Silent = 0 Then MsgBox(4096, "Scite Config", "Definitions for:" & $PRODUNCTIONTEXT & " copied to Scite." & $msgtext, 10)
Else
    If $Silent = 0 Then ProgressSet(50, "Copying files version:" & $BetaTEXT)
    CopyFiles(@ScriptDir & '\Beta', $SciteDir)
    Sleep(500)
    UpdateAbbr(@ScriptDir & '\Beta\au3abbrev.properties')
    If $Silent = 0 Then ProgressOff()
    If $Silent = 0 Then MsgBox(4096, "Scite Config", "Definitions for:" & $BetaTEXT & " copied to Scite." & $msgtext, 10)
EndIf
GUIDelete()
;update configfile autoit dir
Func Update_Autoit_Path($SciTEPath)
; if still wrong AutoIt3 Directory then prompt for it.
    While Not FileExists($AutoItDir & "\autoit3.exe")
        $AutoItDir = FileSelectFolder("Select the AutoIt3 programfolder", @ProgramFilesDir)
        If @error = 1 Then
            $RC = MsgBox(4100, "Update SciTE Definitions", "do you want to stop the process?")
            If $RC = 6 Then Exit
        EndIf
    WEnd
;**** Check The SciTE directory
    While Not FileExists($SciTEPath & "\properties\au3.properties")
        $SciTEPath = FileSelectFolder("Select the SciTE programfolder", @ProgramFilesDir)
        If @error = 1 Then
            $RC = MsgBox(4100, "Update SciTE Definitions", "do you want to stop the process?")
            If $RC = 6 Then Exit
        EndIf
    WEnd
;Process au3.properties
    $H_Out = FileOpen(@TempDir & "\au3.backup", 2)
    $H_in = FileOpen($SciTEPath & "\properties\au3.properties", 0)
    If $H_in = -1 Then
        If $Silent = 0 Then MsgBox(0, "Error", "Unable to open file:" & $SciTEPath & "\properties\au3.properties")
        Exit
    EndIf
    If $Debug = 1 Then
        FileWriteLine(@ScriptDir & "\updateDefs.log", "4. $AutoItDir=" & $AutoItDir)
        FileWriteLine(@ScriptDir & "\updateDefs.log", $SciTEPath & "\properties\au3.properties")
    EndIf
    While 1
        $irec = FileReadLine($H_in)
        If @error = -1 Then ExitLoop
        If StringLeft($irec, 11) = "autoit3dir=" Then
            If $Debug = 1 Then FileWriteLine(@ScriptDir & "\updateDefs.log", "Found autoit3dir=" & $irec)
            $irec = "autoit3dir=$(SciteDefaultHome)\.."
            If $Debug = 1 Then FileWriteLine(@ScriptDir & "\updateDefs.log", "New   autoit3dir=" & $irec)
        EndIf
        FileWriteLine($H_Out, $irec)
    WEnd
    FileClose($H_in)
    FileClose($H_Out)
    
; save last version
    FileCopy($SciTEPath & "\properties\au3.properties", $SciTEPath & "\properties\au3_Old.properties", 1)
; move new file to au3.properties
    FileDelete($SciTEPath & "\properties\au3.properties")
    If Not FileMove(@TempDir & "\au3.backup", $SciTEPath & "\properties\au3.properties", 1) Then
        If $Silent = 0 Then MsgBox(0, "Error", "Unable to copy au3.backup to " & $SciTEPath & "\au3.properties")
    EndIf
    If $Debug = 1 Then
        FileWriteLine(@ScriptDir & "\updateDefs.log", "*** Start New Au3.properties *****************************************************************")
        FileWriteLine(@ScriptDir & "\updateDefs.log", FileRead($SciTEPath & "\properties\au3.properties"))
        FileWriteLine(@ScriptDir & "\updateDefs.log", "*** END   New Au3.properties *****************************************************************")
    EndIf
; Reload the properties to ensure the Path is updated when SciTE is already running.
    Reload_Config()
EndFunc ;==>Update_Autoit_Path
;
Func CopyFiles($fromdir, $todir)
    FileCopy($fromdir & "\*.*", $todir & "\properties\", 1)
    FileCopy($fromdir & "\api\au3.api", $todir & "\api\", 1)
;FileCopy($fromdir & "\Au3Check\*.*", $todir & "\Au3Check\", 1)
    FileCopy($fromdir & "\FuncPopUp\*.*", $todir & "\FuncPopUp\", 1)
    FileCopy($fromdir & "\Tidy\au3.api", $todir & "\Tidy\", 1)
EndFunc ;==>CopyFiles
;
Func UpdateAbbr($NewAbbrFile)
    Local $AbbrFile, $H_Input, $H_Output, $H_NewInput, $I_Rec
    $UserDir = $SciteDir
    $AbbrFile = $UserDir & "\abbrev.properties"
    $H_Output = FileOpen(@TempDir & "\abbrev.properties", 2)
; read current abbrev.properties till the end or stuff we put in
    FileWriteLine(@ScriptDir & "\updateDefs.log", "$AbbrFile=" & $AbbrFile)
    FileWriteLine(@ScriptDir & "\updateDefs.log", "@TempDir=" & @TempDir)
    If FileExists($AbbrFile) Then
        $H_Input = FileOpen($AbbrFile, 0)
        If $H_Input <> -1 Then
            FileWriteLine(@ScriptDir & "\updateDefs.log", "* Start writing start section.")
            $I_Rec = FileReadLine($H_Input)
            While @error = 0 And $I_Rec <> "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
                FileWriteLine($H_Output, $I_Rec)
                $I_Rec = FileReadLine($H_Input)
            WEnd
    ; Now read till the end of our definition
            $I_Rec = FileReadLine($H_Input)
            FileWriteLine(@ScriptDir & "\updateDefs.log", "* Skipping midle section.")
            While Not @error And $I_Rec <> "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
                $I_Rec = FileReadLine($H_Input)
            WEnd
    ; Now copy records put after our stuff to the new file
            FileWriteLine(@ScriptDir & "\updateDefs.log", "* Start writing our $AbbrFile.")
            $I_Rec = FileReadLine($H_Input)
            While Not @error
                FileWriteLine($H_Output, $I_Rec)
                $I_Rec = FileReadLine($H_Input)
            WEnd
            FileClose($H_Input)
        EndIf
    EndIf
; write all records to NewAbbrev file
    If FileExists($NewAbbrFile) Then
; add \ to SciTEpatrh and change each \ to \\
; get new registry settings for AutoIt3 location
        $AutoItDir = StringReplace($AutoItDir & "\", "\", "\\")
        FileWriteLine(@ScriptDir & "\updateDefs.log", "$AutoItDir=" & $AutoItDir)
        $H_NewInput = FileOpen($NewAbbrFile, 0)
        If $H_NewInput <> -1 Then
            FileWriteLine($H_Output, "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#")
            FileWriteLine($H_Output, "Created by UpdateDefs  (don't change anything between the dashed lines)")
            FileWriteLine($H_Output, "#------------------------------------------------------------")
            $I_Rec = FileReadLine($H_NewInput)
            While Not @error
                FileWriteLine($H_Output, StringReplace($I_Rec, "C:\\Program Files\\Autoit3\\", $AutoItDir))
                $I_Rec = FileReadLine($H_NewInput)
            WEnd
            FileWriteLine($H_Output, "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#")
            FileClose($H_NewInput)
        EndIf
    EndIf
    FileClose($H_Output)
    FileCopy($AbbrFile, $AbbrFile & ".bak", 1)
    $RC = FileMove(@TempDir & "\abbrev.properties", $AbbrFile, 1)
    FileWriteLine(@ScriptDir & "\updateDefs.log", "FileReplaced $AbbrFile rc=" & $RC)
EndFunc ;==>UpdateAbbr
;
Func Reload_Config()
    Opt("WinSearchChildren", 1)
;Send SciTE Director my GUI handle so it will report info back from SciTE
    Local $SciTE_hwnd = WinGetHandle("DirectorExtension")
    SendSciTE_Command(0, $SciTE_hwnd, "reloadproperties:")
EndFunc ;==>Reload_Config
;
Func SendSciTE_Command($My_Hwnd, $SciTE_hwnd, $sCmd)
    Local $WM_COPYDATA = 74
    Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
;ConsoleWrite('-->' & $sCmd & @lf )
    DllStructSetData($CmdStruct, 1, $sCmd)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
    DllStructSetData($COPYDATA, 1, 1)
    DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
    DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
    DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $SciTE_hwnd, _
            'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, _
            'Ptr', DllStructGetPtr($COPYDATA))
EndFunc ;==>SendSciTE_Command
Edited by wraithdu
Link to comment
Share on other sites

FROM : n00b

TO: EXPERTS

So this portable AutoIT ver, does this include the SciTE Scriptwriter? I am using that extensively until I have some time to work on the REAL writing of scripts.

I need it to move from server to server to basically install apps (I have admin rights on all these boxes for what that is worth). Then for the next 20 projects I do I can just run-run-run!!!! Any help and advice is greatly appreciated.

Chris.Abel

Link to comment
Share on other sites

  • 9 months later...

How does one create associations?

i came up with the following but it didnt work:

RegWrite("HKEY_CLASSES_ROOT\.au3", "", "REG_SZ", "AutoIt3Script")
RegWrite("HKEY_CLASSES_ROOT\.au3", "PerceivedType", "REG_SZ", "text")
RegWrite("HKEY_CLASSES_ROOT\.au3\ShellNew", "FileName", "REG_SZ", "AutoIt3Script")

RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script", "", "REG_SZ", "AutoIt v3 Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\DefaultIcon", "", "REG_SZ", @MyDocumentsDir & "\My Dropbox\Apps\AutoIt3\Icons\au3script_v10.ico")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell", "", "REG_SZ", "Open")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile", "", "REG_SZ", "Compile Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile with Options\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "%l"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Edit", "", "REG_SZ", "Edit Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\SciTE.exe" "%1"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Open", "", "REG_SZ", "Open")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\SciTE.exe" "%1"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run", "", "REG_SZ", "Run Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\AutoIt3.exe" "%1" %*')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Tidy\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\Tidy\Tidy.exe" "%1"')

if FileExists(@WindowsDir & "\assoc.bat") Then
            FileDelete(@TempDir & "\assoc.bat")
            FileWrite(@TempDir & "\assoc.bat", "assoc .au3=AutoIt3Script" & @CRLF & "exit")
        Else
            FileWrite(@TempDir & "\assoc.bat", "assoc .au3=AutoIt3Script" & @CRLF & "exit")
        EndIf

ShellExecute(@TempDir & "\assoc.bat")
Link to comment
Share on other sites

How does one create associations?

i came up with the following but it didnt work:

RegWrite("HKEY_CLASSES_ROOT\.au3", "", "REG_SZ", "AutoIt3Script")
RegWrite("HKEY_CLASSES_ROOT\.au3", "PerceivedType", "REG_SZ", "text")
RegWrite("HKEY_CLASSES_ROOT\.au3\ShellNew", "FileName", "REG_SZ", "AutoIt3Script")

RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script", "", "REG_SZ", "AutoIt v3 Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\DefaultIcon", "", "REG_SZ", @MyDocumentsDir & "\My Dropbox\Apps\AutoIt3\Icons\au3script_v10.ico")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell", "", "REG_SZ", "Open")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile", "", "REG_SZ", "Compile Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile with Options\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "%l"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Edit", "", "REG_SZ", "Edit Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\SciTE.exe" "%1"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Open", "", "REG_SZ", "Open")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\SciTE.exe" "%1"')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run", "", "REG_SZ", "Run Script")
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\AutoIt3.exe" "%1" %*')
RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Tidy\Command", "", "REG_SZ", @MyDocumentsDir & '\My Dropbox\Apps\AutoIt3\SciTE\Tidy\Tidy.exe" "%1"')

if FileExists(@WindowsDir & "\assoc.bat") Then
            FileDelete(@TempDir & "\assoc.bat")
            FileWrite(@TempDir & "\assoc.bat", "assoc .au3=AutoIt3Script" & @CRLF & "exit")
        Else
            FileWrite(@TempDir & "\assoc.bat", "assoc .au3=AutoIt3Script" & @CRLF & "exit")
        EndIf

ShellExecute(@TempDir & "\assoc.bat")
For a good answer to your question its nescessary to know for which OS you want to accomplish this?

Since Vista this became really a pain (though they created a com interface specially for it).

Creator

Link to comment
Share on other sites

XP ^_^

Kewl. XPsp2 here. I did a quick processmonitor on changing the association. Seems you are missing some current_user keys in you script. Ill try and isolate all needed keys so you can check what are missing.

Link to comment
Share on other sites

XP ;)

Current_User keys needed for association:

Sequence,"Time of Day","Process Name","PID","Operation","Path","Result","Detail"

n/a,"14:13:36,7039154","rundll32.exe","5124","RegCreateKey","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3","SUCCESS","Desired Access: Maximum Allowed"

n/a,"14:13:36,7045795","rundll32.exe","5124","RegSetValue","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Application","SUCCESS","Type: REG_SZ, Length: 20, Data: SciTE.exe"

n/a,"14:13:36,7062414","rundll32.exe","5124","RegCreateKey","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\OpenWithList","SUCCESS","Desired Access: Read/Write"

n/a,"14:13:36,7110247","rundll32.exe","5124","RegSetValue","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\OpenWithList\MRUList","SUCCESS","Type: REG_SZ, Length: 14, Data: afdbec"

n/a,"14:13:36,7113826","rundll32.exe","5124","RegCreateKey","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\OpenWithProgids","SUCCESS","Desired Access: Maximum Allowed"

n/a,"14:13:36,7570730","rundll32.exe","5124","RegCreateKey","HKCU\Software\Microsoft\Windows\CurrentVersion","SUCCESS","Desired Access: All Access"

Its still in processmonitor format, but im lazy today ^_^

Creator

-edit- which narrows down to "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Application" "Type: REG_SZ, Data: SciTE.exe" the rest is irrelevant

Edited by Creator
Link to comment
Share on other sites

  • 9 months later...

Hey everybody. Don't know if anyone still reads this thread, but I coded my own code to launch SciTe portably.

Could someone take a look at it and see if there is anything that I'm missing to make it truly portable?

#Include <File.au3>
#NoTrayIcon ;Self-explanitory, hides the sometimes tacky tray icon that by default shows when a script is running.
;==============================Variables (see comments for more info)========================================
$au3props = @ScriptDir & "\App\SciTe\properties\au3.properties" ;$au3props is where the properties file (au3.properties) is.
$au3folder = @ScriptDir & "\App\"   ;$au3folder is where the folder is located. Change this if you want to,
                                    ;for example, place the launcher in the same directory as Autoit3 or SciTe.
                                    
$workingdir = $au3folder ;$workingdir is what working directory you want to use in SciTe. (e.g. folder you want it to default to when saving a script.)
;You can use $workingdir = $au3folder if you wish to save in the Portable Autoit3 directory (or wherever you specified that Autoit is located.)

_FileWriteToLine ( $au3props, 1, "autoit3dir=" & $au3folder, 1 )
ShellExecute ( @ScriptDir & "\App\SciTe\SciTe.exe", "", $workingdir )
Exit
Link to comment
Share on other sites

  • Developers

Isn't the self-extracting installer the same thing as a portable AutoIt?

Do you mean the ZIP file?

That isn't a portable version unless you arrange a couple of items.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 6 months later...

I made a portable version of AutoIt3 (3.2.12.1).

Just put the content of the zipfile in the root of your usb-drive. Its important that the directorystructure is maintained.

I programmed it to be PortableApps(which i use) ready. You can get it at http://portableapps.org

All that had to be done, was create a launcher which modifies au3.properties(scite) on run.

And i modified autoit3wrapper.au3 and autoit3wrapper_gui.au3 to act portable.

In my situation my launcher sits next to a directory(called App) which contains the full contents of the autoit3 installation folder.

My launcher looks like this:

#include <File.au3>
#include <Array.au3>

Dim $arProps
_FileReadToArray(@ScriptDir & "\App\Scite\properties\au3.properties",$arProps)
For $i=1 To $arProps[0]
    If StringUpper(StringLeft(StringStripWS($arProps[$i],1), 11)) = 'AUTOIT3DIR=' Then
        $arProps[$i] = 'autoit3dir=' & @ScriptDir & '\App'
    EndIf
Next

_FileWriteFromArray(@ScriptDir & "\App\Scite\properties\au3.properties",$arProps, 1)

Run(@ScriptDir & "\App\Scite\Scite.exe", @ScriptDir & "\App\Scite")

Of course its completely up to yourself how to modify au3.properties. This is just an example.

I also included the graphical debugger from http://thefoolonthehill.net/AutoIt_AutoIt_Debugger.htm which is also portable. You do need .NET 2.0 framework on host pc though!

You can debug(graphically) your active script by pressing ctrl+2 or look for "Graphical Debugger" in the scite tools menu.

You can start scite from usbdrive:\PortableApps\AutoIt\Scite_Launcher.exe. If you have portableapps installed on your drive, there will be a menu-item called "AutoIt" in your portableappsmenu.

You can change the directorystructure only when you adjust $Portable_AutoItDir in autoit3wrapper.au3 and autoit3wrapper_gui.au3 (in scitedir\AutoIt3Wrapper)and edit the AutoIt.au3 (tha launcher in usbdrive:\PortableApps\AutoIt).

Grtz. ;)

-edit- Autoit3wrapper_Gui doesnt display autoit version(always 0.0.0.0) when preparing compile in the unmodified script. It doesnt bother me, but when it does to you, you'll have to edit autoit3wrapper_gui.au3 and recompile.

-edit2- When using the unmodified Autoit3wrapper_Gui(on stick) on a host pc where autoit is already installed, the wrapper will use the installed version for doing the compile. You can easely detect if you use your portable version on a host WITH autoit installed. The version number in AutoItWrapper_Gui will not be 0.0.0.0 but the version number of the installed autoit version on the host

I dont understand how an .au3 script is going to do anything on a

computer that doesnt have AutoIt already installed.

I mean how do you run a script on another pc, the .au3 wont even be recognized as anything by the system?

Link to comment
Share on other sites

You simply compile the .AU3 to an .EXE and because the Aut2Exe program can be run without installing you download the Self-Extracting file of AutoIt and compile that way.

Download: http://www.autoitscript.com/autoit3/downloads.shtml

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I created a similar version of AutoIt Portable and its now 100% Portable with the .session file being saved directly to the Scite folder and not the %APPDATA% folder. I also added error checking to the Script/Program.

Download: #830915

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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