Old 17th February 2007, 16:56   #1
Rocco
Junior Member
 
Join Date: Feb 2007
Location: Austria
Posts: 9
absolutly newbie question

hi all,

my head is smoking.
i thaught i'll do an installer in a few minutes (muhaaaaahaaa)
ok now im sitting here with nsis and after a few hours, i got an idea what i need and how i can reach this goal.
i know how i can specify different language files and do some file operations after that to achive what i need,
but im missing one important peace in the puzzle.
the most important in fact for an installer.

now comes the dumb question:
i dont know, how i insert or reference the programm (folder) where the files are in, to the script.
This files (programm) for that i need the installer.

i have found some functions but it seems that they are all for fileoutput but not for input.

Like SetOutPath (i need the opposite)
mabe its the File Command?
but in the examples it looks like that its also for output.

thx for an example.

ps:
i strongly missed a guide (NSIS for dummys)
with an step by step example from an programmfolder to an functioning installer-file. :-)
cause the examplesnippets dont make it easy for an noob to filter and rearrange the standard-things that most installers have.
Rocco is offline   Reply With Quote
Old 17th February 2007, 17:02   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
NSIS Quick Setup Script Generator might get your feelings up.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 17th February 2007, 19:04   #3
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
The File command has dual use: during compile time it gathers and compresses your file(s) and at runtime it extracts them. During compile time it uses the path in the File command (eg, FILE myGreatApp.exe, will look for 'myGreatApp.exe' relative to the folder the nsi script is in), and during execution it will put it where you choose with the SetOutPath command.

You can add a path to the FILE filename, and it will use that to find the file to compress: FILE ".\path1\path2\myApp.*"

Don
demiller9 is offline   Reply With Quote
Old 17th February 2007, 19:11   #4
Rocco
Junior Member
 
Join Date: Feb 2007
Location: Austria
Posts: 9
thanks, this helps alot. :-)
Rocco is offline   Reply With Quote
Old 18th February 2007, 15:26   #5
Rocco
Junior Member
 
Join Date: Feb 2007
Location: Austria
Posts: 9
one problem again.
in my first handcollected example, i have a section which makes no errors (i dont know if it works, cause i wasnt so far by now- but no errors):

Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
${Switch} $LANGUAGE
${Case} ${LANG_ENGLISH}
Rename "$INSTDIR\speech.dcp" "$INSTDIR\speech_ger.dcp"
Rename "$INSTDIR\speech_eng.dcp" "$INSTDIR\speech.dcp"
${Break}
${EndSwitch}
FunctionEnd



now in the generated file, i tried to copy the same code in the Function .onInit
but get this error message:

Invalid command: ${Switch}
Error in script "C:\Programme\3tools\NSIS\Examples\Mystic Triddle Demo.nsi" on line 91 -- aborting creation process

what could be the reason for this??
Rocco is offline   Reply With Quote
Old 18th February 2007, 15:34   #6
Rocco
Junior Member
 
Join Date: Feb 2007
Location: Austria
Posts: 9
ok i found the error reason bymyself it was a missing !include "LogicLib.nsh"

unfortunatly the above code with the renames of the files dont works :-( in the installed game.

what could be the reason, that this commands dont works?

Rename "$INSTDIR\speech.dcp" "$INSTDIR\speech_ger.dcp"
Rename "$INSTDIR\speech_eng.dcp" "$INSTDIR\speech.dcp"

Last edited by Rocco; 18th February 2007 at 16:14.
Rocco is offline   Reply With Quote
Old 18th February 2007, 16:59   #7
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
I haven't figured out quite what you are doing, so my questions may be offtrack -

Does $INSTDIR have the right value when you are trying to use it?

Do the files exist before you have extracted them? Are you adding something to an existing program, or are these dcp files supposed to be installed by you?

Could these files be in use, and locked?
demiller9 is offline   Reply With Quote
Old 18th February 2007, 17:08   #8
Rocco
Junior Member
 
Join Date: Feb 2007
Location: Austria
Posts: 9
im not experienced enough to answer all your questions, but i'll try.

the reason why im using an installer is that i have 2 different language versions.
the programm read the strings from the file speech.dcp.
no matter what the language is, so i take on language as standard speech.dcp file (german), and ifsomeone klick englisch i want have to rename the speech files.
speech.dcp (delete) or -> speech_ger.dcp
speech_eng.dcp -> speech.dcp - programm can use the englsich translation.

i guess the path is the right one (root) - $INSTDIR
i dont know if the file exists before extraction, but i guess not, these files are supposed to be installed by me.
so i assume with the above code, i try to rename files, before they are really there.

what is the right solution.
Rocco 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