Re: AHK Portable Installer v1.20
Posted: 17 Sep 2021, 12:36
Thanks man, appreciate the kind and understanding words - always feel I waste the time of you ahk gurus by asking dumb Qs and doing dumb things - appreciate it
.
![Smile :-)](./images/smilies/icon_e_smile.gif)
Let's help each other out
https://www.autohotkey.com/boards/
LOL ... if you were the only to have ever done something "dumb" then I might agree, but you are definitely NOT the only one to have "learned by making mistakes".
Same system - Windows 10 Pro, X-64. My personal laptop.Are you setting this up on the same system or a different system?
I'm trying to use it in the "Installer Mode" and want to use the #REQUIRES directive in each script.Are you trying to install the ahk file associations? Or are you running in "Fully Portable Mode" this time?
Ah, this might be a possible issue - I've currently got it in "C:\Program Files\ahk-pi-master"!!In what location (directory) did you put ahk-pi-master?
beta.2Also, are you using AHK beta.1 or beta.2 for the EXE?
Err, nothing other than not knowing this was a thingIs there anything preventing you from right-clicking on the EXE and selecting "Run as Administrator"?
The fact that you got "access denied" means you put it in a location you can't write to, that isn't going to work well.
Brilliant - thanks for explaining thatThe x puts the default back to notepad.exe which would have no effect on whether the main LV populates downloaded/chosen versions.
I did a complete fresh install, so initially there was no versions folder. So then created a versions folder and populated it: And I think that I followed your instructions for v2 folder setup - though am now surprised there are files in the v2 Compiled other than Ahk2Exe.exe!So... In your script dir for ahk-pi, there should be a versions folder with your chosen versions of AHK. Or, that folder should be empty if its a fresh copy of ahk-pi. Do you have anything in the versions folder like one of your previous screenshots suggest?
Code: Select all
;~ #Requires AutoHotkey 2.0-beta.2
;~ MsgBox "Current version of AHK = " A_AhkPath " \ " A_AhkVersion
#Requires AutoHotkey 1.1.33
MsgBox, Current version of AHK = %A_AhkPath%\%A_AhkVersion%
DaveT1 wrote: ↑19 Oct 2021, 05:06But, if you're still in anyway motivated to still help this utter noob, then, for a simple script like
Code: Select all
;~ #Requires AutoHotkey 2.0-beta.2 ;~ MsgBox "Current version of AHK = " A_AhkPath " \ " A_AhkVersion #Requires AutoHotkey 1.1.33 MsgBox, Current version of AHK = %A_AhkPath%\%A_AhkVersion%
Code: Select all
#Requires AutoHotkey 2.0- ; <--- this uses the latest ahk v2 beta found
#Requires AutoHotkey 2.0-beta ; <--- this is the same as above
#Requires AutoHotkey 1.1 ; <--- uses the latest AHK v1.1 found, not limited to 1.1.33
#Requires AutoHotkey 2 ; <--- this uses a release of ahk v2 that does not yet exist, a legit non-beta release
#Requires AutoHotkey 2.1 ; <--- this is the same as above, but requires non-beta v2.1 - which doesn't yet exist
Only got there because of your patienceWell that's a relief! I'm still interested to find out how you manged to not have the EXEs in those sub-folders. I actually don't use the "download feature" that I created, because I do place my versions in a separate folder location, manually, but I don't omit the EXEs of course. I only added the download feature because I could, and it helped to lower the bar for over-all complexity of using the program. So, manually "curating" your collection of AHK versions to use on your system is not the issue (technically).
OK, understood. It does seem that the SciTE4AutoHotkey block comment style (;~...) doesn't cause an issue for the ahk-pi parser, but I get your general comment about not having more than one #Requires directive.Right off the bat, having 2 #Requires directives in one script (even if one is commented) is probably part of the problem. Even a commented out #Requires directive is parsed because most older versions of AHK don't support it. So I coded ahk-pi to parse even commented out #Requires directives. Although the way you crafted ;~... should mitigate this issue.
Right, that's a great point. But now that I exclusively only use the ahk-pi Download button, I think all the right .exe files for each AHK version should be present and correct?It is also important to point out that AFTER ahk-pi decides which EXE to use, the #Requires directive is used by AHK itself. The version of EXE that executes the script must be >= the version specified in the #Requires directive. So you need to be sure of what versions of AHK are in your versions folder.
Understood about being too strict - thanks for pointing that out. I've changed my little 'version' script accordingly.Your usage of the #Requires directive is strict, and requires beta.2, therefore any other AHK v2 beta will not suffice. Did you in fact put beta.2 EXEs in the versions folder?
...You would be better off with something like one of the top 2 examples below that are less restrictive:
Ah, I may have worded this badly and left it open to interpretation. I was intending to show the folder location of the .exe that was being used. Consider, for example, a script with the follwoing code:As for the "Autohotkey.exe is in use" error message, that is odd. AutoHotkey can be run in multiple instances of itself. Usually if a script is already running, it will tell you so, and ask if you want to replace the existing instance with a new instance. Post the error messages after trying some of what I've suggested above.
Code: Select all
#Requires AutoHotkey 1.1
MsgBox, Current version of AHK = %A_AhkPath%\%A_AhkVersion%
Code: Select all
Compiler=$(AutoHotkeyDir)\Compiler\Ahk2Exe.exe
AutoHotkey=$(AutoHotkeyDir)\AutoHotkey.exe
Thus far, this aspect is working like a charm. I'll obviously keep an eye on it, fully anticipating that any issues will be on this side of my keyboard!In regards to running the scripts by double-click or shortcut, that should not be an issue. Let me know if it is.
I tend to use SciTE4AHK for quick scripts - it was the editor that I started with. But I'm trying to transition to VS Code in an effort to (a) use a tool that has a wider user-base and active development, and (b) it has version control built in (and I'm trying to learn to do the right thing and use this)!Just setup SciTE4AHK and tried running a simple script on my system, it didn't work. I'll have to mess with it to figure out how to get it to work.
EDIT:
If you like, I can help you setup Notepad++. That's what I use, and there is a plugin to press SHIFT+F5 to run a currently running script (it uses the system file associations). You can of course also setup syntax highlighting as well. There are some limited call tips available, but mostly for Ahk v1.