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.

 

Go Back   Doom9's Forum > Programming and Hacking > Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th October 2006, 17:13   #1  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
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
Seems to work so far.
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 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 22nd October 2006, 12:59   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
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.
LoRd_MuldeR is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.