Archive: absolutly newbie question


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.


NSIS Quick Setup Script Generator might get your feelings up.


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


thanks, this helps alot. :-)


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??


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"


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?


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.