Jump to content


Photo

Portable AHK & AHKL custom .bat installer


  • Please log in to reply
17 replies to this topic

#1 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 04 February 2010 - 12:43 PM

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.

#2 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 28 June 2010 - 06:52 PM

[deleted]

#3 Chicken Pie 4 Tea

Chicken Pie 4 Tea
  • Members
  • 377 posts

Posted 15 September 2010 - 02:57 PM

Cool, thanks for this, will try it out soon

#4 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 15 October 2010 - 07:40 AM

I provided bat files for download.

#5 MacroMan!

MacroMan!
  • Members
  • 604 posts

Posted 15 October 2010 - 02:18 PM

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

#6 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 15 October 2010 - 02:19 PM

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.

#7 semi225599

semi225599
  • Members
  • 269 posts

Posted 16 October 2010 - 03:23 AM

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?

#8 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 16 October 2010 - 10:52 AM

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.

#9 semi225599

semi225599
  • Members
  • 269 posts

Posted 16 October 2010 - 02:50 PM

Okay that makes sense.
This could be in a different post, but If anyone is looking for a portable solution, PortableFileAssociator works great.

#10 vaderetro

vaderetro
  • Members
  • 20 posts

Posted 22 December 2010 - 06:02 PM

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

#11 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 25 December 2010 - 07:17 PM

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

#12 vaderetro

vaderetro
  • Members
  • 20 posts

Posted 12 January 2011 - 02:28 PM

this worked perfectly, thanks!

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

#13 codybear

codybear
  • Members
  • 589 posts

Posted 12 January 2011 - 06:59 PM

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

#14 vaderetro

vaderetro
  • Members
  • 20 posts

Posted 16 January 2011 - 01:10 PM

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.



#15 codybear

codybear
  • Members
  • 589 posts

Posted 16 January 2011 - 07:14 PM

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