Old 26th August 2003, 20:07   #1
ijerkovi
Member
 
Join Date: Jul 2003
Posts: 61
Question NSIS Windows 2000 File Association Problem?!

This is my code. It works on my XP box (albeit without proper icon showing up) but it does not show up on Windows 2000 box??!!

Function fileAssociation
ReadRegStr $0 HKCR "Applications\cView.exe\shell\open\command" ""
;MessageBox MB_OK "$0"

WriteRegStr HKCR ".rpt" "" "rptfile"

WriteRegStr HKCR "rptfile\DefaultIcon" "" "$0,0"
WriteRegStr HKCR "rptfile" "" "cView File"
WriteRegStr HKCR "rptfile\shell\open\command" "" "$0"

StrCpy $9 " $\"%1$\""
StrCpy $1 $0
Call removeFromString
WriteRegStr HKCR "rptfile\shell\open\command" "" "$1"

;set icon please work!!
WriteRegStr HKCR "rptfile\DefaultIcon" "" "$1,0"

FunctionEnd

There was another thread regarding this topic but I was not able to get an answer from anyone.

The cView demo version can be downloaded from http://www.recrystallize.com/merchant/chelsea/cview.htm

You can install it and try associating a ".rpt" file (can create a dummy one for testing) and see if you can get nsis to correctly associate rpt files with it.

Any help is highly appreciated.
ijerkovi is offline   Reply With Quote
Old 26th August 2003, 20:45   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Please don't start new threads but continue in the old one. Can you give a link or include the removeFromString function?
Joost Verburg is offline   Reply With Quote
Old 26th August 2003, 20:55   #3
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Put a messagebox command after calling the "removeFromString" function and say the result of use with the Windows 2000 and XP Operational Systems.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 26th August 2003, 21:00   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Something like this should work:

ReadRegStr $0 HKCR "Applications\cView.exe\shell\open\command" ""

...remove stuff from $0 here...

WriteRegStr HKCR ".rpt" "" "rptfile"

WriteRegStr HKCR "rptfile\DefaultIcon" "" "$0,0"
WriteRegStr HKCR "rptfile" "" "cView File"
WriteRegStr HKCR "rptfile\shell\open\command" "" "$0"
Joost Verburg is offline   Reply With Quote
Old 27th August 2003, 14:27   #5
ijerkovi
Member
 
Join Date: Jul 2003
Posts: 61
Thanks! But!

I've tried this code last week without success (on windows 2000). XP works but not windows 2000?! I've placed instructions on the first post in regards to the program I am trying to use. If anyone can get it going would be most appreciated!!
ijerkovi is offline   Reply With Quote
Old 27th August 2003, 14:32   #6
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
As I already said, please post the remove-from-string function and the code you use to remove stuff from the string. Maybe you can debug it using messageboxes.
Joost Verburg is offline   Reply With Quote
Old 27th August 2003, 15:42   #7
ijerkovi
Member
 
Join Date: Jul 2003
Posts: 61
Thanks for reply I have now determined what the problem is: cView does not install it self into registry the same on XP and same on win2000.
ijerkovi is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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