| View previous topic :: View next topic |
| Author |
Message |
Dewi Morgan
Joined: 03 Oct 2005 Posts: 178
|
Posted: Tue Jun 26, 2007 10:14 am Post subject: Shellnew ahk script |
|
|
A minor niggle, I admit: possibly more a feature request, than a bug.
The installer (as I just discovered) overwrites, without prompting, any shellnew ahk script.
I had modified D:\WINNT\ShellNew\Template.ahk with my own comment header and the things I tend to always use in scripts ('#NoEnv' and other good-practice lines). _________________ Yet another hotkeyer. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Tue Jun 26, 2007 11:22 am Post subject: |
|
|
Are you sure? It's explicitly designed not to do that. Here's the relevant section from the NSIS script: | Code: | SetOutPath "$WINDIR\ShellNew"
; The following line was added to the version after v1.0.41.02 to preserve any customizations users
; have made to their Template file.
SetOverwrite off
File "Template.ahk"
SetOverwrite on |
|
|
| Back to top |
|
 |
Dewi Morgan
Joined: 03 Oct 2005 Posts: 178
|
Posted: Tue Jun 26, 2007 12:39 pm Post subject: |
|
|
It is entirely possible that ack of sleep is making me even more retarded than usual. Possibly I overwrote it by myself. Except... no, I *know* I created an ahk file using file/new on this machine earlier today, and it didn't contain the default template.
I shall doublecheck.
You are correct. AHK scripts created from "rightclick->new->ahk script" before and after installing are identical. I have no idea why the last one got deleted.
Unless...
Maybe it's being treated as "ifnewer" instead of "off", for some reason known only to my machine. Let's dig up a file creation/modification date changer and see if I can reproduce that.
...Nope. Used FileDate changer to change this and still no overwriting.
Try on my laptop - nope.
Try one last thing: I used tweakui to install a new ahk script template on this machine the first time. I shall do that again.
Bingo!
Oh, that's good - I am not going insane after all. Turns out that if you use drag-drop onto TweakUI to install your ShellNew items, it does NOT place them in the D:\WINNT\ShellNew, but instead into D:\Documents and Settings\Administrator\Templates, leaving the old copy in ShellNew\.
Then it creates the key HKEY_CLASSES_ROOT\.ahk\ShellNew\Filename="wikipedia_autocorrect.ahk"
My bet is that if I install again, that key will get blatted by the installer.
Testing....
Yes, overwritten with the value "Template.ahk".
But... is this even a bug?
I really don't know if TweakUI compatibility is worth coding in a check for on that key. There is a clear and obvious workaround for this problem: don't use TweakUI, instead copy into the ShellNew dir with the name "Template.ahk". Nothing is being overwritten, and my original template file still exists, hidden by TweakUI safely away in D:\Documents and Settings\Administrator\Templates.
Notabug, I think? _________________ Yet another hotkeyer. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Wed Jun 27, 2007 10:40 am Post subject: |
|
|
| Thanks for the followup and the workarounds. Since my NSIS skills are meager, I agree that no extra code is worthwhile for this. However, the location where the template file gets written is probably not in keeping with the latest Microsoft recommendations. It should probably be put somewhere more appropriate in a future version. |
|
| Back to top |
|
 |
|