xiaoy926
10th November 2005 05:14 UTC
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
JasonFriday13
10th November 2005 05:25 UTC
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.
xiaoy926
10th November 2005 07:30 UTC
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
Afrow UK
10th November 2005 08:56 UTC
It's probably something wrong in your batch file. Perhaps you are missing quotes around %1.
-Stu
xiaoy926
10th November 2005 09:29 UTC
here is my batch file:
pushd C:\Program Files\ImageJ
start wjview /cp ij.jar;swing.jar;plugins ij.ImageJMain %1
popd
Afrow UK
10th November 2005 10:02 UTC
Try putting quotes around %1
-Stu
xiaoy926
11th November 2005 08:57 UTC
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
Afrow UK
11th November 2005 10:19 UTC
Try this:
pushd C:\Program Files\ImageJ
start wjview '/cp ij.jar;swing.jar;plugins ij.ImageJMain "%1"'
popd
-Stu
xiaoy926
14th November 2005 01:17 UTC
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