AutoHotkey Community

It is currently May 27th, 2012, 12:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: February 4th, 2010, 1:43 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
AHK Portable Installer

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
  • Test.ahk it will run in AutoHotKey
  • Test.ahkl it will run in AutoHotKey_L
  • 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:

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

_________________
Image


Last edited by majkinetor on October 15th, 2010, 3:23 pm, edited 18 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2010, 7:52 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
[deleted]

_________________
Image


Last edited by majkinetor on October 15th, 2010, 8:37 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2010, 3:57 pm 
Offline

Joined: August 18th, 2009, 12:07 pm
Posts: 375
Location: holland
Cool, thanks for this, will try it out soon

_________________
"Choose your parents wisely"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2010, 8:40 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I provided bat files for download.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 15th, 2010, 3:18 pm 
Offline

Joined: August 28th, 2009, 11:17 am
Posts: 599
Location: Brighton, UK
majkinetor wrote:
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

_________________
With mixed feelings I am stepping down from all moderation responsibilities: http://www.autohotkey.com/forum/viewtopic.php?t=82906


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2010, 3:19 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2010, 4:23 am 
Offline

Joined: June 12th, 2010, 10:33 pm
Posts: 269
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2010, 11:52 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2010, 3:50 pm 
Offline

Joined: June 12th, 2010, 10:33 pm
Posts: 269
Okay that makes sense.
This could be in a different post, but If anyone is looking for a portable solution, PortableFileAssociator works great.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 22nd, 2010, 7:02 pm 
Offline

Joined: November 8th, 2010, 5:49 pm
Posts: 16
majkinetor wrote:
Quote:
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!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2010, 8:17 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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).

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2011, 3:28 pm 
Offline

Joined: November 8th, 2010, 5:49 pm
Posts: 16
this worked perfectly, thanks!

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2011, 7:59 pm 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
Location: Tempe, Arizona
Why not an AHK file instead of a batch file? :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2011, 2:10 pm 
Offline

Joined: November 8th, 2010, 5:49 pm
Posts: 16
codybear wrote:
Why not an AHK file instead of a batch file? :D


he explains it in the post:

majkinetor wrote:
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2011, 8:14 pm 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
Location: Tempe, Arizona
vaderetro wrote:
codybear wrote:
Why not an AHK file instead of a batch file? :D


he explains it in the post:

majkinetor wrote:
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: MSN [Bot] and 33 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group