Archive: possible? InstallOptions with variable


possible? InstallOptions with variable
Is that possible to manage?



!insertmacro MUI_INSTALLOPTIONS_READ ${TEMP1} $0 "Field 2" "State"

SectionEnd

...

Function .onInit

;Extract InstallOptions INI Files
StrCmp $LANGUAGE "1033" 0 +2
StrCpy $0 res\shortcuts_ger.ini
StrCmp $LANGUAGE "1031" 0 +2
StrCpy $0 res\shortcuts_eng.ini
;StrCmp $LANGUAGE "1036" 0 +2
; StrCpy $0 "res\shortcuts_fre.ini"

!insertmacro MUI_INSTALLOPTIONS_EXTRACT "$0" <-- causes errormessage


message:
!insertmacro: MUI_INSTALLOPTIONS_EXTRACT
File: "$0" -> no files found.

Push - pop ?
I have no idea :(

PS hope it is possible otherwise i have to write same code x-times for each language

maybe using:


!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "X"

You will have to write the same code for each language because $0 is a runtime variable and not a compile time variable. NSIS has to know it needs to compress all of those INI files, it won't guess at compile time that you want all of those when you only tell it to get $0 (which is treated as $0 and not the value $0. Again, because it's a runtime variable).


thank u

another question:

original filename ist "shortcuts.ini"

i like to use "shortcuts_fre.ini" or "shortcuts1033.ini" but this names might be too long? the options are not shown in last cases. is there a name length limit?


The is no name length limitation (well, there is, but I doubt you'll ever get there :))


Multilanguage InstallOptions
Try this

LangString OPT_IMPORTDB_FILE ${LANG_ENGLISH} "OptImportDBEN.ini"
LangString OPT_IMPORTDB_FILE ${LANG_PORTUGUESE} "OptImportDBPT.ini"
LangString OPT_IMPORTDB_FILE ${LANG_PORTUGUESEBR} "OptImportDBBR.ini"
LangString OPT_IMPORTDB_FILE ${LANG_POLISH} "OptImportDBPL.ini"

push $R0
StrCpy $R0 $(OPT_IMPORTDB_FILE)
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG $R0
!insertmacro MUI_INSTALLOPTIONS_SHOW
pop $R0
pop $R0


good luck
Ramon