Go Back   Winamp Forums > Developer Center > NSIS Discussion

Closed Thread
Thread Tools Search this Thread Display Modes
Old 27th June 2003, 00:54   #1
mcrbids
Junior Member
 
Join Date: Jun 2003
Posts: 2
How to Register File Types?

I'm attempting to write an installer for a php-gtk program. I've figured out most of it, except that I need to register the ".php" filetype with the correct executable so that the application will actually run.

I can't find this anywhere in the documentation... how do I do this?

I want to register the ".php" filetype with application

c:\Program Files\php4\php_gtk.exe

Thanks!
mcrbids is offline  
Old 27th June 2003, 01:57   #2
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
What you need is to create some registry keys/enties in
code:
HKEY_LOCAL_MACHINE\Software\Classes
first you need to create a ".php" key with the description of the file type. Then create a key with the description as the name.

Check the registy for some examples of the keys/entries.

Vytautas
Vytautas is offline  
Old 27th June 2003, 11:41   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
The NSIS installer registers .nsi and .nsh. Its source code can be found in Examples\makensis.nsi. Is someone up to creating an Archive page for this?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline  
Old 27th June 2003, 13:52   #4
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Archive page created here

Vytautas
Vytautas is offline  
Old 27th June 2003, 19:14   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
Thanks.

The code you've copied also backups the old value so it would be nice if you include the uninstall part too that shows the reinsertion of the backuped value.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline  
Old 28th June 2003, 01:47   #6
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Will do as soon as i can, probably in a few hours

Vytautas
Vytautas is offline  
Old 28th June 2003, 05:36   #7
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Updated archive page to include restoration script for uninstaller. Thanks kichik for pointing this out.

Vytautas
Vytautas is offline  
Old 23rd November 2004, 12:49   #8
rene@alquesm.dk
Guest
 
Posts: n/a
Exclamation Note

Jsut wanted to add, that according to the MSDN, it's important to notify the system that you have made a change. You do this with the function SHChangeNotify. To notify Windows of a file association change, call the function like this:

SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_DWORD, NULL, NULL);

If you do not call this function, Windows might not recognize your new filetype, or the change you made, before the system has been restarted.

Best regards
René Gundersen (rene@alquesm.dk)
 
Old 7th December 2005, 22:55   #9
super-llooyd
Junior Member
 
Join Date: Dec 2005
Posts: 11
how do i call this SHChangeNotify?
(in NSIS I mean?)
super-llooyd is offline  
Old 8th December 2005, 02:26   #10
dandaman32
Senior Member
 
dandaman32's Avatar
 
Join Date: Jan 2005
Location: Look behind you.
Posts: 209
Use the System plugin.
code:
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'


-dandaman32

ExperienceUI for NSIS | Latest project: Enano CMS
Do not PM me on the Winamp forums, I hardly ever check my messages here; you are more likely to get my attention through the ExperienceUI forum.
dandaman32 is offline  
Old 14th July 2006, 21:18   #11
IGC
Junior Member
 
Join Date: Jul 2006
Posts: 1
Question

I have a question regarding this...

I was able to register the .igc extensions with my program.
Everytime I click on one of the .igc files the program executes correctly BUT..

The parameter passed to the program (the .igc file clicked) has a limited length. When that limit is passed the parameter contains tildes (~) on the path and in the filename.

For example: I click on "D:/Documents/My_files/igc_files/file to open.igc", my program executes, but the paramter passed to the program is something like: "D:/DOCU~/MY~/IGC~/FILET~1.igc"

When this happens my program can't find the passed file and it is not opened.

How do I solve this problem?

It does not affect the execution of the program, and if I use the Open button on my program the files open correctly, but it is an extrange behaviour that can be viewed as a bug on the code...

EDIT:
I found the source of the problem...
after shell\open\command I forgot to put quotes between the path to my executable. I do not know how that affects the arguments passed to the program, but it does.
Everything works perfect now.

Last edited by IGC; 14th July 2006 at 21:47.
IGC is offline  
Closed Thread
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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