Archive: how to associate a certain file type with the launched program with nsis


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


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.


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


It's probably something wrong in your batch file. Perhaps you are missing quotes around %1.

-Stu


here is my batch file:

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


Try putting quotes around %1

-Stu


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


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

-Stu


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