Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
14th October 2006, 17:13 | #1 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
File Associations
That's my NSIS script to set File Asscociations:
Code:
Section DeleteRegKey HKCR ".foo" WriteRegStr HKCR ".foo" "" "FooFile" WriteRegStr HKCR "FooFile" "" "Foo File Type" WriteRegStr HKCR "FooFile\DefaultIcon" "" "foo.exe,0" WriteRegStr HKCR "FooFile\shell" "" "open" WriteRegStr HKCR "FooFile\shell\open\command" "" 'foo.exe "%1"' System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)' SectionEnd BUT: Sometimes it's neccesarry to open Explorer, goto Extras > Options > File Types, seach the new file type in the list and click the "Restore" button. If you don't do that, it'll open the files with the old app. Why is that and is there a way to fix it in my NSIS script ???
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
22nd October 2006, 12:59 | #2 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Seems I found the answer
File Asscociations are not only stored at HKEY_CLASSES_ROOT\.foo They are also stored here HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.foo To set it up properly, it needs to clean up both locations! Code:
Section DeleteRegKey HKCR ".foo" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.foo" WriteRegStr HKCR ".foo" "" "FooFile" DeleteRegKey HKCR "FooFile" WriteRegStr HKCR "FooFile" "" "Foo File Type" WriteRegStr HKCR "FooFile\DefaultIcon" "" "foo.exe,0" WriteRegStr HKCR "FooFile\shell" "" "open" WriteRegStr HKCR "FooFile\shell\open\command" "" 'foo.exe "%1"' System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)' SectionEnd
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 4th November 2006 at 17:37. |
|
|