Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

No INI causes portability problem


  • Please log in to reply
23 replies to this topic
Keybored as guest
  • Guests
  • Last active:
  • Joined: --
When downloading zip Version 1.0.46.08 I have noticed it does not make an ini file as before. Instead it creates a ahk file in My Documents. This affects portability when running from a network drive or USB key.

My current workaround is to manually make an ini file in the same folder.

Thanks, Eric (Keybored)

Grumpy
  • Guests
  • Last active:
  • Joined: --
Can you provide more info on how this affects portability? What are the use cases?

ahklerner
  • Members
  • 1386 posts
  • Last active: Oct 08 2014 10:29 AM
  • Joined: 26 Jun 2006
@Grumpy.....Previously AHK would create the ini in the directory which ahk was in. Now it will create the file in the My documents folder. I can see where this could be a problem in situations where users can not or should not save files to the hard drive. I use ahk from a flash drive at work and do not particularly want files with funny file extentions floating around...Just something else for someone to ask questions about...

I would like to request that the ahk file be created in the application directory and not in the my documents folder.

Of course I do understand that this is only an issue when ahk is ran directly (without a script being called)...I do do that on occasion to have the help & ASW handy....

Keybored as guest
  • Guests
  • Last active:
  • Joined: --
Grumpy thanks for the question.
When you unzip to a USB drive
Edit your auhothotkey from tray
Unplug and move to a new pc
None of your edits are available. Definite portability problem if it goes unnoticed by the user.

Another consequence is when upgrading my sister was confused because she was only aware of the ini type file. I have brought her up to speed on the change.

tonne
  • Members
  • 1654 posts
  • Last active: May 06 2014 06:22 PM
  • Joined: 06 Jun 2006

upgrading my sister


... to sister2.0?

BoBo
  • Guests
  • Last active:
  • Joined: --

I have brought her up to speed

:lol:

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
This change was made primarily because it's more compatible with Windows Vista. In addition, I think My Documents is a more useful default for most people.

If anyone can think of another approach that has a better cost/benefit for the general public, please post here. Also, if there's any other reason this is being reported as a bug (i.e. something that should be fixed), please let me know.

keybored
  • Members
  • 351 posts
  • Last active: Apr 26 2013 09:08 AM
  • Joined: 18 Jun 2006
I agree let's see what others think. Is this important to other people?

The reason I thought it should change is other sites are referring to the portability and ability to run from USB. Just unzip and run.

To run or not to run?
Currently when running AHK the first time it gives you the choice of creating the file in the My Document folder. When you choose not to it fails to work.

Perhaps changing the prompt to include 2 radio button to select where?

keybored
  • Members
  • 351 posts
  • Last active: Apr 26 2013 09:08 AM
  • Joined: 18 Jun 2006
tonne

... to sister2.0?

My Sister will be glad to know she has been upgraded to Sister 2.0 all thanks to a punctuation error on my part.

Sister 2.0 Now compatible with AutoHotKey.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

Currently when running AHK the first time it gives you the choice of creating the file in the My Document folder. When you choose not to it fails to work.

This "default script" behavior was originally added just to make things easier for those who hadn't read the Quick-start Tutorial. I'd never envisioned that anyone would run AutoHotkey.exe directly just to get access to the tray menu of the sample script.

So assuming that most people who double-click AutoHotkey.exe are new users, creating the sample script in My Documents seems superior because the file is more easily found and edited. Furthermore, Windows Vista doesn't allow a program to create a publicly-accessible script in the Program Files directory. Instead, such a script would become private to the program, which would make it difficult to edit.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

So assuming that most people who double-click AutoHotkey.exe are new users, creating the sample script in My Documents seems superior because the file is more easily found and edited. Furthermore, Windows Vista doesn't allow a program to create a publicly-accessible script in the Program Files directory. Instead, such a script would become private to the program, which would make it difficult to edit.

While I understand that the change was made mainly for Windows Vista users (I run AHK on Vista also), I also disagree with saving to the the Documents folder by default. A better approach might be to:

- Check whether an .ini file exists in the program directory first then detect whether the user is using Vista

- If the user is using Vista, the .ini file doesn't exist in the application's directory, and AHK is being run from the default Program Files directory then prompt whether to create the file in the documents directory or whether to attempt to create it in AHK's directory. If AHK isn't run from the Program Files location then it doesn't make much of a difference and the previous method of saving in AHK's directory should likely be used for the reasons mentioned above.

You may not be aware but it is possible for an application to create files in the Program Files directory in Vista if the application is "run as administrator".

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

A better approach might be to:
- Check whether an .ini file exists in the program directory first

For backward compatibility, it does indeed check for AutoHotkey.ini in the current directory, and runs it if found.

...then detect whether the user is using Vista

It might be best to have consistent behavior across all OSes:
1) Dual-boot systems would otherwise experience results that differ depending on OS.
2) The rules are simpler and easier to remember.
3) Vista will gradually begin crowding out XP systems, just as XP crowded out Win9x and 2000. So it might be best to get people used to the current behavior in case they later upgrade to Vista. Otherwise, upon upgrading the behavior would suddenly change, which might be counterintuitive.

You may not be aware but it is possible for an application to create files in the Program Files directory in Vista if the application is "run as administrator".

Yes, though I don't see how it directly helps.

I also disagree with saving to the the Documents folder by default.

But no particular reasons beyond those already mentioned?

If you or anyone still thinks some other method is better for the general public, please give details explaining why.

Thanks.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
I guess what I'm saying is that I'd prefer to be prompted to optionally save in the Documents directory only if saving in the current directory is not possible. It's probably more a matter of personal taste though and I'll likely have to comply with Vista's methods eventually. I like to keep my egss in their own baskets whenever possible. I tend to store only documents in document folders and they are usually in descriptive folders within the Document directory. To be fair though, this change doesn't have much an effect for me as I don't usually intentionally run AHK without any params.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Perhaps AHK should drop the idea of creating a file by itself when run without parameter. This way, no question asked, or perhaps, if user agree, open the help at the tutorial section. Otherwise, it can just execute a default script with only one instruction: #Persistent, providing access to help and window spy.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
It's a good alternative, but the sample-script method might be more valuable (assuming the user can get past the confusion of the Yes/No dialog). This is because the user gets to see an actual script, and they can see that it's a plain text file, etc. Furthermore, the user can easily learn-by-example from the sample script and then make more hotkeys via the Run command, which would avoid the need for them to read the Quick-start Tutorial.

I know what it's like trying new software, especially how frustrating it can be when you can't get up and running quickly. I think the sample script is good because it allows users to get up and running with some basic hotkeys in only 5 minutes.

Contrary opinions are welcome.