xiaoy926
8th November 2005 05:43 UTC
Nsis can crreate installer for a non-exe project
Dear all
I know the NSIS can create a installer for a exe program, but I am wondering whether it can do this for a non-exe program,if so, how can it do that?
whoever knows this, please give me some comments. I am a newer for NSIS.
thanks in advance
dongfang
Animaether
8th November 2005 07:31 UTC
Using NSIS, you can 'install' all kinds of files - whether they be EXEs, DLLs, JPG, TXT files or anything else.
Simply use the "SetOutPath" and "File" instructions to write the given files to the path specified, and that's all there is to it.
Is there anything specific you're trying to install ?
xiaoy926
8th November 2005 08:06 UTC
My program runs with wjview command, which is included in a bat file.
before running the command wjview, it needs to know the directory of the program.
xiaoy926
8th November 2005 08:31 UTC
for the exe program,NSIS defines the running variable like that :
!define MUI_FINISHPAGE_RUN "$INSTDIR\MyProgram.exe"
but if the program is not exe project and runs with a batch file, I define the running variable like this:!define MUI_FINISHPAGE_RUN "$INSTDIR\myprogam.bat". Compile succeeds but running fails.
I am wondering whether the problem is that I can't define this variable like this for non-exe program or I need to do another configurations.
thank you very much.
dongfang
kichik
8th November 2005 18:14 UTC
You can use MUI_FINISHPAGE_RUN_FUNCTION and use ExecShell in the specified function, or simply recreate the batch file contents in NSIS script.
dekel
8th November 2005 21:46 UTC
Reading System.nsh, seems that it uses Exec command to run the target, which will not work for batch files. What you want to do, is use something like $SYSDIR\cmd.exe /c <batch_file_name.bat>.
Haven't tested it, but it should work...
Part of System.nsh
------------------------
!ifdef MUI_FINISHPAGE_RUN
!insertmacro MUI_INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 4" "State"
StrCmp $MUI_TEMP1 "1" 0 mui.finish_norun
!ifndef MUI_FINISHPAGE_RUN_FUNCTION
!ifndef MUI_FINISHPAGE_RUN_PARAMETERS
StrCpy $MUI_TEMP1 "$\"${MUI_FINISHPAGE_RUN}$\""
!else
StrCpy $MUI_TEMP1 "$\"${MUI_FINISHPAGE_RUN}$\" ${MUI_FINISHPAGE_RUN_PARAMETERS}"
!endif
Exec "$MUI_TEMP1"
!else
Call "${MUI_FINISHPAGE_RUN_FUNCTION}"
!endif
mui.finish_norun:
!endif
kichik
8th November 2005 21:51 UTC
cmd.exe is not available on Windows 9x, only command.com.
xiaoy926
10th November 2005 04:34 UTC
kichik
thank you very much.
I just recreate the batch file contents in NSIS script and set this file for MUI_FINISHPAGE_RUN_FUNCTION. It works well.
regards
dongfang