Talk:File Association: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 31: Line 31:


-----
-----
Hi. I've tried this using NSIS 2.44 and this doesn't seem to work. According to the compiler output the file is included, and there are message about registerExtension/unregisterExtension, but when i install the software and try to open a file with my extension, windows open the usual window asking which software should be used.
Hi. I've tried this using NSIS 2.44 and this doesn't seem to work. According to the compiler output the file is included, and there are message about registerExtension/unregisterExtension, but when i install the software and try to open a file with my extension, windows open the usual window asking which software should be used.
The example on this page is fairly straightforward, i copy/pasted it and i can't see what i could have done wrong... :-(
The example on this page is fairly straightforward, i copy/pasted it and i can't see what i could have done wrong... :-(
If i use regedit, it seems that on my computer most extensions are associated with something identifying the file (mimetype or something else i dont know). While if i run my installer, the key "My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.myext" has keys REG_SZ set to the executable i give in first arg to registerExtension... i'm getting confused somehow.


Orzel - may 4th, 2009, i'm using Windows XPsp2
Orzel - may 4th, 2009, i'm using Windows XPsp2

Revision as of 21:33, 4 May 2009

I have a problem, while trying to associate a file, under Windows XP, everything works fine, but on Windows 2000, when I try to open a file, it looks like the path is not managed in the correct way, this is the way the file path is being sent on my application c:\prog~1\archi~1 so, i don´t know what´s going on, i´d really apreciate your help.

I think the problem is in this line

 WriteRegStr HKCR "ReportUncompressor.Script\shell\open\command" "" '"ReportUncompressor.exe" "%1"'

oscargl2017@hotmail.com


The 'OptionsFile' correspondant Registry key is only deleted when the association was in possession of another application before.

-decimad

I had to change the line

   WriteRegStr HKCR "OptionsFile\shell\edit\command" "" \
   '$INSTDIR\execute.exe "%1"'

to:

   WriteRegStr HKCR "OptionsFile\shell\edit\command" "" \
   '"$INSTDIR\execute.exe" "%1"'

(Put quotation marks around the path to my execute.exe).

Otherwise when opening a file its path got truncated something like: c:\Prog~1\blabla~1\. My system is Windows XP, haven't tested it with other versions.


One other thing; you may also have to update the user's explorer fileexts list before a file association change actually takes (the items in this list override those in HKCR).

 HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

ZeBoxx 20:21, 25 February 2009 (UTC)


Hi. I've tried this using NSIS 2.44 and this doesn't seem to work. According to the compiler output the file is included, and there are message about registerExtension/unregisterExtension, but when i install the software and try to open a file with my extension, windows open the usual window asking which software should be used. The example on this page is fairly straightforward, i copy/pasted it and i can't see what i could have done wrong... :-(

If i use regedit, it seems that on my computer most extensions are associated with something identifying the file (mimetype or something else i dont know). While if i run my installer, the key "My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.myext" has keys REG_SZ set to the executable i give in first arg to registerExtension... i'm getting confused somehow.

Orzel - may 4th, 2009, i'm using Windows XPsp2