Old 8th November 2005, 04:43   #1
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
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
xiaoy926 is offline   Reply With Quote
Old 8th November 2005, 06:31   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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 ?
Animaether is offline   Reply With Quote
Old 8th November 2005, 07:06   #3
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
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 is offline   Reply With Quote
Old 8th November 2005, 07:31   #4
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
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
xiaoy926 is offline   Reply With Quote
Old 8th November 2005, 17:14   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You can use MUI_FINISHPAGE_RUN_FUNCTION and use ExecShell in the specified function, or simply recreate the batch file contents in NSIS script.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th November 2005, 20:46   #6
dekel
Junior Member
 
Join Date: Nov 2005
Posts: 1
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
dekel is offline   Reply With Quote
Old 8th November 2005, 20:51   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
cmd.exe is not available on Windows 9x, only command.com.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 10th November 2005, 03:34   #8
xiaoy926
Junior Member
 
Join Date: Nov 2005
Posts: 10
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
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