 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Damein
Joined: 27 Aug 2009 Posts: 296
|
Posted: Thu Oct 08, 2009 3:41 pm Post subject: AHK for U3 FlashDrives |
|
|
It would be awesome if someone could make AHK useable via a flashDrive, namely a U3.
If this is already done, and I missed it in my searchings, let me know  |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Thu Oct 08, 2009 3:54 pm Post subject: |
|
|
Autohotkey should already be portable in that manner, you just have to download the zip file and extract the exe to your flash drive rather than downloading the installer. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Damein
Joined: 27 Aug 2009 Posts: 296
|
Posted: Thu Oct 08, 2009 4:14 pm Post subject: |
|
|
Oh, so it is
Thanks a lot  |
|
| Back to top |
|
 |
Obi-Wahn
Joined: 20 Apr 2006 Posts: 75 Location: Vienna
|
Posted: Wed Oct 14, 2009 12:20 pm Post subject: |
|
|
Well, creating a U3 Package isn't that hard. I've created one, but I haven't tested it jet (especially writing into registry and deleting OnExit).
DOWNLOAD AHK U3-Package (Right Click, Save Target as...)
The Launcher Code:
| Code: | ; regAHK
;
SetWorkingDir, %A_ScriptDir%
#NoEnv
#Singleinstance, ignore
If (1 = "/Src") {
FileInstall, regAHK.ahk, regAHK.ahk, 1
ExitApp
}
editr = %1%
OnExit, Cleanup
RegAHKExt()
Menu, Tray, NoStandard
Menu, Tray, Add, AutoHotkey Help File, helpfile
Menu, Tray, Add, AutoIt3 Window Spy, auspy
Menu, Tray, Add, AutoScriptWriter (recorder), record
Menu, Tray, Add
Menu, Tray, Add, AutoHotkey Website (ENG), ahkwseng
Menu, Tray, Add, AutoHotkey Website (DEU), ahkwsdeu
Menu, Tray, Default, AutoHotkey Help File
Return
Cleanup:
check := UnRegAHKExt()
If check {
Sleep, 5000
check := UnRegAHKExt()
}
If check {
Msgbox, 16, ERROR, Some Registrykeys remained. Please delete them manually.
}
ExitApp
Return
helpfile:
Run, %A_Scriptdir%\AuotHotkey.chm
Return
auspy:
Run, %A_Scriptdir%\AU3_Spy.exe
Return
record:
Run, %A_Scriptdir%\AutoScriptWriter\AutoScriptWriter.exe
Return
ahkwseng:
Run, http://www.autohotkey.com
Return
ahkwsdeu:
Run, http://de.autohotkey.com
Return
RegAHKExt(launch=true, edit=true, compile=true) {
global editr
ahkdir := A_ScriptDir
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, .ahk, , AutoHotkeyScript
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, .ahk\ShellNew, FileName, %ahkdir%\Template.ahk
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\AutoHotkey, InstallDir, %ahkdir%
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\AutoHotkey, Version, %A_AHKVersion%
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript, , AutoHotkey Script
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\DefaultIcon, , %ahkdir%\AutoHotkey.exe`,1
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell, , Open
openscr := A_Language="0407" ? "Script starten" : "Run Script"
editscr := A_Language="0407" ? "Script editieren" : "Edit Script"
compscr := A_Language="0407" ? "Script kompilieren" : "Compile Script"
If launch {
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Open, , %openscr%
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Open\Command, , %ahkdir%\AutoHotkey.exe "`%1"
}
If edit {
editor := !editr ? "notepad.exe" : editr
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Edit, , %editscr%
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Edit\Command, , %editor% "`%1"
}
If compile {
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Compile, , %compscr%
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Compile\Command, , %ahkdir%\Compiler\Ahk2Exe.exe /in "`%1"
}
Return, 1
}
UnRegAHKExt() {
RegDelete, HKEY_CLASSES_ROOT, AutoHotkeyScript
err += Errorlevel
RegDelete, HKEY_CLASSES_ROOT, .ahk
err += Errorlevel
RegDelete, HKEY_LOCAL_MACHINE, SOFTWARE\AutoHotkey
err += Errorlevel
Return, err=0 ? true : false
}
|
If there's an issue, just modify the code, recompile it, open the u3p package with winrar, and move the compiled script with the name 'regAHK.exe' into the right folder ('Device').
Cheers
Obi-Wahn
PS.: Please notify my when there are Bugs.
PPS.: This script writes into registry. If there are any damages to the computer or the RegWrite doesn't work because of an lack of User-Rights, I'm not reponsible for.
PPPS.: The Package is tested with virustotal.com. 1 Hit out of 32. eSafe reports a malicious file (maybe upx.exe). I've compiled the script w/o UPX. |
|
| Back to top |
|
 |
-C3- Guest
|
Posted: Sat Oct 17, 2009 10:10 am Post subject: |
|
|
| I just copy/pasted AHK program file onto my thumb drive. Then when you run a .ahk file on a different computer and it ask what program to use to open it you find the ahk exe on the drive. |
|
| Back to top |
|
 |
codybear
Joined: 15 Sep 2009 Posts: 560
|
Posted: Tue Nov 03, 2009 1:14 am Post subject: |
|
|
| -C3- wrote: | | I just copy/pasted AHK program file onto my thumb drive. Then when you run a .ahk file on a different computer and it ask what program to use to open it you find the ahk exe on the drive. |
What I did was to create a batch file that I had autorun execute on my flash drive.
Go here:
| Quote: | | http://ss64.com/nt/ |
Read up on ftype and assoc
then create a batch file that automatically associates autohotkey with that on your flash drive.
I also had my batch file associate a few other programs and also changed my flash drive's letter to z, which is what it is labeled as on my home computer. that way, if I have any hardcoded paths in ahk scripts or any other programs, then they would still work.
If you'd like to me to post my batch file for an example, let me know.
(I won't be able to till I get home from school,am currently on my laptop) |
|
| Back to top |
|
 |
bekihito
Joined: 03 Feb 2010 Posts: 38 Location: Zagreb, Croatia
|
Posted: Sat Feb 27, 2010 5:41 pm Post subject: |
|
|
Perhaps this can help:
http://www.lupopensuite.com/db/expresso.htm
You might want to check everything else on the Lupo pensuite pages as well.
Lots of interesting programs most of them free - really helpfull for compiling a handy flash memory "office in a pocket". |
|
| Back to top |
|
 |
codybear
Joined: 15 Sep 2009 Posts: 560
|
Posted: Thu Apr 01, 2010 2:51 am Post subject: |
|
|
| bekihito wrote: | Perhaps this can help:
http://www.lupopensuite.com/db/expresso.htm
You might want to check everything else on the Lupo pensuite pages as well.
Lots of interesting programs most of them free - really helpfull for compiling a handy flash memory "office in a pocket". |
Nice. I'll have to look into a little bit more when I get a chance.
But in my case, my batch script (which I just made an ahk file that will do this for me now), but anyways, it works just fine for my case as I use it at school only.
The school computers have a deep freeze program on it so everytime it's restarted, all settings go back to how they were. So I can do whatever I want, and it doesn't do a single thing to the computer.
I now have a rainmeter desktop, rocketdock, and a bunch of other mods that are done through an ahk script to setup the computer to my liking so I can be more "productive."  |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Thu Apr 01, 2010 4:10 am Post subject: |
|
|
http://ss64.com/nt/ very nice link i usually refer to microsofts command ref but i like this one better _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
codybear
Joined: 15 Sep 2009 Posts: 560
|
Posted: Fri Apr 02, 2010 2:25 am Post subject: |
|
|
Wow. I never thought I'd have something tank would want to use.
Eventhough it's just a link....I'll take what I can get. haha. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|