Rocco
19th February 2007 19:26 UTC
rename function doesnt work
im trying tu use an installer cause 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, and ifsomeone klick the other language i want to rename the speech files.
speech.dcp (delete) or rename -> speech_1.dcp
speech_eng.dcp -> speech.dcp - programm can use the english translation.
this is the code in the Function .onInit:
Rename "$INSTDIR\speech.dcp" "$INSTDIR\speech_ger.dcp"
Rename "$INSTDIR\speech_eng.dcp" "$INSTDIR\speech.dcp"
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.
thx demiller9 for the help so far,
any suggestions what is the solution for that?
Joel
19th February 2007 19:43 UTC
What's the path for $INSTDIR? Try a MessageBox to see if there's a valid path for ya.
Rocco
19th February 2007 20:11 UTC
the path should be the right one, its the root directory.
but isnt it the problem, that the files arent there when i try to rename them?
how can i test the the path with a messagebox?
MessageBox MB_OK "$INSTDIR" - like this?
Joel
19th February 2007 20:57 UTC
Originally posted by Rocco
the path should be the right one, its the root directory.
but isnt it the problem, that the files arent there when i try to rename them?
how can i test the the path with a messagebox?
MessageBox MB_OK "$INSTDIR" - like this?
To see if a file is there, use
IfFileExits.
MessageBoxMB_OK
"$INSTDIR"
Rocco
19th February 2007 21:16 UTC
ok i checked the path with
MessageBox MB_OK "$INSTDIR"
and it is the right one.
but the problem is the files arent there at this moment.
what is somehow logical for me, cause the first thing are the settings, and in this moment the programm (and the files that i want to rename) isnt installed. so this operations must be performed after the install-process or in the compressed setup file.
and this is my problem, what can i do?
Joel
20th February 2007 02:24 UTC
Ok, I understand...
Maybe you should try the /oname from instruction File.
Maybe you should try to send it to the pluginsdir and then call Rename.
Rocco
21st February 2007 15:11 UTC
ok i got a solution, finally. (thank god, and all how helped me further :-))
i copied the text after the FILE commands and now it works.
${Switch} $LANGUAGE
${Case} ${LANG_ENGLISH}
Delete $INSTDIR\speech.dcp
Rename "$INSTDIR\speech_eng.dcp" "$INSTDIR\speech.dcp"
${Break}
${EndSwitch}