Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Portable AHK & AHKL custom .bat installer


  • Please log in to reply
17 replies to this topic
majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
AHK Portable Installer
[*:1k1o3k9v]Installer for AHK
[*:1k1o3k9v]Installer for AHKL

NOTE: You may need to Run as administrator (right click the bat and choose this option).



This is .bat file which you should save in the AHK(_L) folder.
When you run it, it will associate AHK executable with ahk scripts, associate icon and extension handler.

It can also be used with any other app, just change SETUP section as needed.

This batch script allows you to copy AHK folder to different computers without using official installer and quickly associate it with AHK. Its also handy for testing different AHK branches as you can only add or remove "l" to extension to run the script with different ahk branch.

If your file is named
[*:1k1o3k9v] Test.ahk it will run in AutoHotKey
[*:1k1o3k9v] Test.ahkl it will run in AutoHotKey_L
[*:1k1o3k9v] Test.ahkXXX will run AutoHotKeyXXX. XXX is something of your choosing - specific version of AHK or branch. Add the extension you like, change the bat file SETUP section and thats it.
You may wonder, why not using AHK to do this. The answer: AHK may not be installed. Batch is system script and it works on every computer.

The quick way to deduce what will run is to notice the icon in explorer.

To use the single portable folder for stdlib, make NTFS junction in AutoHotKey_L folder from AutoHotKey folder. To do this, you can for instance use this little app:

junction.exe d:\Utils\AutoHotKey_L\Lib d:\Utils\AutoHotKey\Lib

Or better, keep Libs out of AHK folders and junction to both of them. Then you add new libs only to this folder and they will be automatically seen by both versions of AHK (or multiple versions if you have them). That way you don't risk deleting Libs if for some reason you choose to delete your AHK folder and reinstall it.
Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
[deleted]
Posted Image

Chicken Pie 4 Tea
  • Members
  • 379 posts
  • Last active: Dec 12 2014 06:46 PM
  • Joined: 18 Aug 2009
Cool, thanks for this, will try it out soon
"Choose your parents wisely"

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
I provided bat files for download.
Posted Image

MacroMan!
  • Members
  • 604 posts
  • Last active: Mar 20 2012 11:40 AM
  • Joined: 28 Aug 2009

You may wonder, why not using AHK to do this. The answer: AHK may not be installed. Batch is system script and it works on every computer.


I was wondering that, especially as ahk files can easily be compiled to exe's and I think people on here would be more capable modifying an ahk file than a bat file.

However, good script.

David
What ever happened, happened.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
If its compiled, how would you change it ?
Anyway, the script is trivial and setup options are given at the start. If you really need to run more then 2 versions of AHK then I guess changing the bat file will be the least of your problems.
Posted Image

semi225599
  • Members
  • 269 posts
  • Last active: Dec 27 2011 09:23 PM
  • Joined: 12 Jun 2010
Is this meant for installing onto computers, or as a portable solution like on someone else's? If it's portable, then you're leaving file associations on their computer, if it's to install, why not just run the installer? Can you clarify what this would be used for?

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

This batch script allows you to copy AHK folder to different computers without using official installer and quickly associate it with AHK. Its also handy for testing and using different AHK branches as you can only add or remove "l" to extension to run the script with different ahk branch.


Its not portable in sense used by portable.net, since that is your concern. I usually don't like portable programs since they are often buggy, they start slow, leave resident program behind all the time and restoration of local computer to previous state is not of concern to me (since local computer typically doesn't have stuff I want, hence I bring it with me). It has value for mainstream programs that are installed, used and personalized regularly, for instance Winamp.

So, this installer is there so that you don't have to carry with you ~2MB setup file. Its also easier automated (I use batch files like this one on fresh system install - I call all of them at once to install bunch of programs without any other intervention -for /R %%i in (_INSTALL*.bat) do call :Install "%%i").
Other things are already explained above.
Posted Image

semi225599
  • Members
  • 269 posts
  • Last active: Dec 27 2011 09:23 PM
  • Joined: 12 Jun 2010
Okay that makes sense.
This could be in a different post, but If anyone is looking for a portable solution, PortableFileAssociator works great.

vaderetro
  • Members
  • 28 posts
  • Last active: May 14 2017 07:23 PM
  • Joined: 08 Nov 2010

This batch script allows you to copy AHK folder to different computers without using official installer and quickly associate it with AHK. Its also handy for testing and using different AHK branches as you can only add or remove "l" to extension to run the script with different ahk branch.


Its not portable in sense used by portable.net, since that is your concern. I usually don't like portable programs since they are often buggy, they start slow, leave resident program behind all the time and restoration of local computer to previous state is not of concern to me (since local computer typically doesn't have stuff I want, hence I bring it with me). It has value for mainstream programs that are installed, used and personalized regularly, for instance Winamp.

So, this installer is there so that you don't have to carry with you ~2MB setup file. Its also easier automated (I use batch files like this one on fresh system install - I call all of them at once to install bunch of programs without any other intervention -for /R %%i in (_INSTALL*.bat) do call :Install "%%i").
Other things are already explained above.


I use my dropbox folder to 'install' some programs I always use by installing only in one computer, configuring properly and then letting sync to other computers.

Of course not all programs can be configured and installed to work like that, but some do, like Total commander, putty, etc, basically if it has a zip distribution it increases the chances of working.

I guess this will help in adding ahk to these programs right??? thanks!!

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
yes, you can use it also for non-ahk related proggies , just change SETUP section of batch file.

This setup file is from mine 'drop box' as you call it.
For simple cases I use this batch file, for more complex cases I use ahk scripts (its also good to re-enter registration details if needed).
Posted Image

vaderetro
  • Members
  • 28 posts
  • Last active: May 14 2017 07:23 PM
  • Joined: 08 Nov 2010
this worked perfectly, thanks!

As you say, it will be usable too for other cases...

codybear
  • Members
  • 600 posts
  • Last active: Feb 09 2015 12:41 PM
  • Joined: 15 Sep 2009
Why not an AHK file instead of a batch file? :D

vaderetro
  • Members
  • 28 posts
  • Last active: May 14 2017 07:23 PM
  • Joined: 08 Nov 2010

Why not an AHK file instead of a batch file? :D


he explains it in the post:

You may wonder, why not using AHK to do this. The answer: AHK may not be installed. Batch is system script and it works on every computer.



codybear
  • Members
  • 600 posts
  • Last active: Feb 09 2015 12:41 PM
  • Joined: 15 Sep 2009

Why not an AHK file instead of a batch file? :D


he explains it in the post:

You may wonder, why not using AHK to do this. The answer: AHK may not be installed. Batch is system script and it works on every computer.

Compiled ones would work. I was just joking around. :D