language settings on custom page
Hi,
how can I change the language on a customPage?
I've coded the texts hard into the installer script.
But ho can I change the language with the language dialog?
Any ideas?
Thanks...
here is my code:
.
writeinistr "$PLUGINSDIR\checkSummary.ini" "FIELD 3" "State" "0"
!includeWinMessages.nsh
>!include LogicLib.nsh
>; MUI 1.67 compatible ------
!include "MUI.nsh"
>; Language Selection Dialog Settings
>!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
>!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
>!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
>; Welcome page
>!insertmacro MUI_PAGE_WELCOME
>;Custum Function
Page custom showCheckSummary leaveCheckSummary
>; License page
>!define MUI_LICENSEPAGE_CHECKBOX
>!insertmacro MUI_PAGE_LICENSE "Prototype.txt"
>; Directory page
>!insertmacro MUI_PAGE_DIRECTORY
>; Instfiles page
>!insertmacro MUI_PAGE_INSTFILES
>; Finish page
>!insertmacro MUI_PAGE_FINISH
>; Uninstaller pages
>!insertmacro MUI_UNPAGE_INSTFILES
>; Language files
>!insertmacro MUI_LANGUAGE "English"
>!insertmacro MUI_LANGUAGE "German"
>; MUI end ------
>Name "${PRODUCT_NAME}"
>OutFile "Setup_ADEPAut.exe"
>;VAR INI_VALUE
>VAR ERROR_MESSAGE
>Function showCheckSummary
>!insertmacro MUI_HEADER_TEXT "Environment errors" "The following environment checks failed."
>;if no errors were found go to done else goto notEqual
strcmp$9 "false" done notEqual
notEqual:
;
!insertmacro MUI_INSTALLOPTIONS_WRITE "checkSummary.ini" "FIELD 3" "State" "0"
;disable next button
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
;writeinistr "$PLUGINSDIR\checkSummary.ini" "FIELD 2" "State" "$ERROR_MESSAGE"
!insertmacro MUI_INSTALLOPTIONS_WRITE "checkSummary.ini" "FIELD 2" "State" "$ERROR_MESSAGE"
InstallOptions::InitDialog /NOUNLOAD "$PLUGINSDIR\checkSummary.ini"
;ReadINIStr "$0" "$PLUGINSDIR\checkSummary.ini" "FIELD 2" "HWND"
!insertmacro MUI_INSTALLOPTIONS_READ $0 "checkSummary.ini" 'Field 2' 'HWND'
SetCtlColors $0 0x000000 0xFFFFFF
InstallOptions::Show '$PLUGINSDIR\checkSummary.ini'
>done:
>FunctionEnd
>Function leaveCheckSummary
>;readinistr $0 '$PLUGINSDIR\checkSummary.ini' 'Settings' 'State'
>!insertmacro MUI_INSTALLOPTIONS_READ $0 "checkSummary.ini" "Settings" "State"
>${if} $0 == 1
>${elseif} $0 == 3
;readinistr $3 '$PLUGINSDIR\checkSummary.ini' 'Field 3' 'State'
!insertmacro MUI_INSTALLOPTIONS_READ $3 "checkSummary.ini" "FIELD 3" "State"
${if} $3 == 1
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 1
${else}
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
${endif}
abort
${endif}
>FunctionEnd
>Function .onInit
initpluginsdir
gettempfilename$0
rename$0 '$PLUGINSDIR\checksummary.ini'
call WriteIni
;initialise $9 for error handling
strcpy$9 "false"
>!insertmacro MUI_LANGDLL_DISPLAY
>;Check Version-Number
call CheckADVersion
>;Read InstallDir
call GetInstallDir
StrCpy $INSTDIR "$R0"
>StrCpy $INSTDIR "..."
>;Check Simatic Version-Number
call CheckSimaticVersion
>;CheckWindow
FunctionEnd
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
>ShowInstDetails show
ShowUnInstDetails show
Section-Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\cmdhwconfig.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\cmdhwconfig.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
>SectionEnd
>Function GetInstallDir
ClearErrors
ReadRegStr $R0 HKLM "" "PATH"
IfErrors error done
error:
strcpy $9 "true"
strcpy $ERROR_MESSAGE "$ERROR_MESSAGEError while reading Install Directory from Registry.\r\n\r\n"
goto done
done:
>FunctionEnd
>Function CheckADVersion
ClearErrors
ReadRegStr $R1 HKLM "" "RELEASE"
IfErrors error noError
error:
strcpy $9 "true"
strcpy $ERROR_MESSAGE "$ERROR_MESSAGEError while reading Releasenumber of AD_Core_2006 from Registry.\r\n\r\n"
goto goOn
noError:
strLen $2 ${PRODUCT_VERSION}
strcpy $1 $R1 $2
strCmp${PRODUCT_VERSION} $1 goOn
strcpy$9 "true"
strcpy $ERROR_MESSAGE "$ERROR_MESSAGEWrong Releasenumber of AD_Core_2006 (Installed: $R1; Requested: ${PRODUCT_VERSION})\r\n\r\n"
goto goOn
goOn:
goto done
done:
>FunctionEnd
>Function CheckSimaticVersion
ClearErrors
ReadRegStr $R2 HKLM "" "RELEASE"
IfErrors error noError
error:
strcpy $9 "true"
strcpy $ERROR_MESSAGE "$ERROR_MESSAGEError while reading Releasenumber of from Registry.\r\n\r\n"
goto goOn
noError:
strLen $3 ${SIMATIC_VERSION}
strcpy $4 $R2 $3
strCmp${SIMATIC_VERSION} $4 goOn
strcpy$9 "true"
strcpy $ERROR_MESSAGE "$ERROR_MESSAGEWrong Releasenumber of STEP7 (Installed: $R2; Requested: ${SIMATIC_VERSION})\r\n\r\n"
goto goOn
goOn:
goto done
done:
>FunctionEnd
>