Jump to content

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

Enable interaction with administrative programs


  • Please log in to reply
64 replies to this topic
redgum
  • Members
  • 59 posts
  • Last active: Mar 26 2015 01:30 AM
  • Joined: 07 Dec 2007
Newbie question here - how do I run this? After extracting, when I double-click EnableUIAccess.ahk, I get the error "#Include file "<Cert>" cannot be opened." Do the files in the Lib folder need to be put somewhere in particular?

#Include in Help doesn't mention specifying a file using angle brackets, and I couldn't find reference to what they signify. Changing to "#Include Cert.ahk" yielded another error ("Line Text: class Cert
Error: This line does not contain a recognized action.")

Obviously I'm in over my head here. Can someone give me a step-by-step on running this script?

Thanks!

nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
You're using the outdated AutoHotkey Basic, and this script requires AutoHotkey_L. You can find it on the top of the downloads page.

redgum
  • Members
  • 59 posts
  • Last active: Mar 26 2015 01:30 AM
  • Joined: 07 Dec 2007
Damn, my notes say I had _L v1.1.00.01 installed, but obviously not.

Thanks for the help.

Antipodus
  • Guests
  • Last active:
  • Joined: --
Many thanks for very useful script.

scott64
  • Members
  • 9 posts
  • Last active: Jan 09 2012 03:02 PM
  • Joined: 17 Jan 2011
Can anyone help please: I am keen to have digitally signed code - even bought a certificte! - but can't seem to get the above instructions to work: I am using Windows 7 - Loaded latest Ahk.exe dated 25 March 2012 - but I still get the Error @ line 24 problem described above when trying EnableUIAccess.AHK. Tried in IE, Firefox and Chrome - same results in all. Cheers

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Verify that the following reports "1.1.07.03":
MsgBox % A_AhkVersion


scott64
  • Members
  • 9 posts
  • Last active: Jan 09 2012 03:02 PM
  • Joined: 17 Jan 2011
gosh that was quick ..
Yes I can confirm that 1.1.07.03 appears when running script statement you provided.
and then re-tried loading Enable UIAccess with firefox and chrome - same results...

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
If you have extracted the script files from the archive correctly, there is no reason to get the error reported by redgum on v1.1.07.03. Please copy-paste the actual text of the error dialog. You can copy it by simply pressing Ctrl+C.

scott64
  • Members
  • 9 posts
  • Last active: Jan 09 2012 03:02 PM
  • Joined: 17 Jan 2011
as requested here is the actual text:

---------------------------
EnableUIAccess.ahk
---------------------------
Error at line 24.

Line Text: #Include <Cert>
Error: Function library not found.

The program will exit.
---------------------------
OK
---------------------------


Just to be sure I am doing it correctly : Autohotkey_L is loaded in C:\Program Files (x86)\AutoHotkey and there are no other copies of AHK in the PC that I can see. To do download this extension (in chrome) I just clicked on the download button - it came up with EnableUIAccess.zip which when opened has Lib folder and EnableUIAccess.ahk dated /modified 20/‎08/‎2011 ‏‎16:52 (I am using chrome as I have redirected downloads in Firefox) - I am most grateful for you help by the way.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Did you perhaps miss the first step?

After extracting, ...

You need to extract all of the files from the zip, including the Lib folder.

scott64
  • Members
  • 9 posts
  • Last active: Jan 09 2012 03:02 PM
  • Joined: 17 Jan 2011
I am feeling a bit of a dumbo here: Are there a set of instructions that I am missing?
The zipped download file I received contains EnableUIAccess.ahk + Lib folder with[ Cert.ahk Crypt.ahk SignFile.ahk and SystemTime.ahk ] all of which are small files. Am I getting all the correct files?? I tried extracting all these files to the Download folder and running EnableUIAccess from there but it failed. Then tried copying this lot as files to the C:\Program Files (x86)\AutoHotkey folder and running EnableUIAccess from there - but same results. Can you help sort this dumbo out please.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
When you say "it failed", does that mean it gave you exactly the same error message?

Since you already have the latest version of AutoHotkey_L installed, it should be this simple:

[*:1le26nul]Extract the contents of the zip to any folder.
Structure must be preserved. Any decent zip program (or Windows built-in functionality) will do this, unless you tell it not to. To be clear, it should be like this:
EnableUIAccess.ahk
Lib\Cert.ahk
Lib\Crypt.ahk
Lib\SignFile.ahk
Lib\SystemTime.ahk
[*:1le26nul]Run the script.[/list]
"Function library not found" at line 24 implies that %A_ScriptDir%\Lib\Cert.ahk does not exist.

scott64
  • Members
  • 9 posts
  • Last active: Jan 09 2012 03:02 PM
  • Joined: 17 Jan 2011
got it to work this time - so many thanks. Now trying to sign my compiled code with my digital certificate a pfx file but quite unsure of the correct steps. I put a copy of my_cert.pfx in C:\Program Files (x86)\AutoHotkey folder then modified your AHK script line from:

ahk_cert := my.FindCertificates(0, Cert.FIND_SUBJECT_STR, "wstr", "AutoHotkey")[1]
to
ahk_cert := my.FindCertificates(0, Cert.FIND_SUBJECT_STR, "wstr", "my_cert.pfx")[1]
ran it to make updated AutoHotkey.exe and then compiled my ahk script but resulting compiled exe does not appear to have my certificate. - Sorry that I can't manage to do it on my own...

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Install the certificate first, then refer to it by name (not filename).

You may need to restore AutoHotkey.exe to its unsigned state (e.g. by reinstalling).

You may also want to delete the certificate the script just created. Press Win+R, type certmgr.msc, press Enter, find the "my_cert.pfx" certificate listed there and delete it.

scott64
  • Members
  • 9 posts
  • Last active: Jan 09 2012 03:02 PM
  • Joined: 17 Jan 2011
1) using certmgr checked personal certificates to find Autohotkey one plus my code signing one - updated friendly name of mine from 'none' to something more useful.

2) re-installed Autohotkey_L and its properies show it is not signed

3) deleted the autohotkey certificate - as I think that was created by previous run. Did not delete my certificate as I don't know how to re-install it and it looks ok to me.

4) updated your ahk script to use friendly certificate name that I created in (1) above

now when I run your script I get response as below and autohotkey.exe is not signed:

---------------------------
EnableUIAccess.ahk
---------------------------
Failed to create 'AutoHotkey' key container.

ErrorLevel: 0
A_LastError: -2146893809
---------------------------
OK
---------------------------