Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 10th November 2005, 04:14   #1
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
how to associate a certain file type with the launched program with nsis

Dear all

I created a installer for my program with NSIS, now it works.But One certain file type recognized by my program can't be open by double clicking.

Maybe it needs to write some information which associates a certain file type with my program to register when installing.

NSIS can do that? If so, how can it do this?

look forward to your reply.

thanks

dongfang
xiaoy926 is offline   Reply With Quote
Old 10th November 2005, 04:25   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 906
There is an example of this in the nsis setup script (associates .nsi and .nsh with notepad). It is located at '${NSISDIR}\examples\makensis.nsi'. Search it.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 10th November 2005, 06:30   #3
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
here is my code for associating file type with my program:
WriteRegStr HKCR ".qif" "" "HDDImage"
WriteRegStr HKCR "HDDImage" "" "maxtor HDD File"
WriteRegStr HKCR "HDDImage\shell\open" "" "open qif file"
WriteRegStr HKCR "HDDImage\shell\open\command" "" 'ImageJ.bat "%1"'

when double clicking .qif file, I get this error message"windows cannot find'c:\program File\ImageJ\E16YDPTN\C39994H03W001R000.QIF',Make sure you typed the name correctly, and then try again. To search for a file, click the start button,and then click search."

I am crazy with this problem and don't know what is the problem.

thanks in advances

dongfang
xiaoy926 is offline   Reply With Quote
Old 10th November 2005, 07:56   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It's probably something wrong in your batch file. Perhaps you are missing quotes around %1.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th November 2005, 08:29   #5
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
here is my batch file:

pushd C:\Program Files\ImageJ
start wjview /cp ij.jar;swing.jar;plugins ij.ImageJMain %1
popd
xiaoy926 is offline   Reply With Quote
Old 10th November 2005, 09:02   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Try putting quotes around %1

-Stu
Afrow UK is offline   Reply With Quote
Old 11th November 2005, 07:57   #7
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
Stu

I have tried to chanage the bat file like this :
pushd C:\Program Files\ImageJ
start wjview /cp ij.jar;swing.jar;plugins ij.ImageJMain "%1"
popd

or like this :

pushd C:\Program Files\ImageJ
start wjview /cp ij.jar;swing.jar;plugins ij.ImageJMain '%1'
popd

But both of them can't work and still have the same error message.

I still haven't had any idea about this problem.

thank you very much.

dongfang
xiaoy926 is offline   Reply With Quote
Old 11th November 2005, 09:19   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Try this:
pushd C:\Program Files\ImageJ
start wjview '/cp ij.jar;swing.jar;plugins ij.ImageJMain "%1"'
popd

-Stu
Afrow UK is offline   Reply With Quote
Old 14th November 2005, 00:17   #9
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
pushd C:\Program Files\ImageJ
start wjview '/cp ij.jar;swing.jar;plugins ij.ImageJMain "%1"'
popd

my progran cann't run with these commands, so file association also doesn't.

Before creating installer, I run this project with bat file and create a simple program to associate qif file type with this program, and double clicking works well. so my bat file is right.

If the installer doesn't associate file type with program, and then I use the simple associated program, double clicking doesn't work.

Is there some trick I don't know about?

thanks

dongfang
xiaoy926 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