Когда я запускаю установщик в немецком языке, пользовательский интерфейс установщика отображается на немецком языке, но пользовательский интерфейс приложения не отображается на немецком языке.Вместо этого он отображается на английском языке.
Чтобы интерфейс установщика работал в соответствии с локалью, которую я создал, отдельные файлы .nsh (! Include «CustomEnglish.nsh»,! Include «CustomGerman.nsh»,! Include »CustomItalian.nsh ") и включены в мой файл .nsi.Таким образом, он работает, как и ожидалось.
Чтобы пользовательский интерфейс приложения работал в соответствии с локалью, я использую приведенную ниже проверку на основе языка и помещаю файлы (созданные отдельные библиотеки ресурсов для каждого языка) в Установленокаталог.
${If} $Language == 1033 ; English Locale(1033)
File "C:\Desktop\English\license.rtf"
File "C:\Desktop\English\APC PCPE.chm"
File "C:\Desktop\English\AllowStandby.reg"
File "C:\Desktop\English\pchuteres.dll"
File "C:\Desktop\English\relnotes.txt"
File "C:\Desktop\English\res.dll"
${ElseIf} $Language = 1036 ;French Locale(1036)
File "C:\Desktop\French\license.rtf"
File "C:\Desktop\French\APC PCPE.chm"
File "C:\Desktop\French\AllowStandby.reg"
File "C:\Desktop\French\pchuteres.dll"
File "C:\Desktop\French\relnotes.txt"
File "C:\Desktop\French\res.dll"
Это правильный способ размещения dll или файлов на основе локали в каталоге Installed?
А также я не используюоператор! insertmacro MUI_LANGUAGE "Английский" в этом файле .nsi.Потому что это заявление, которое я даю в! Include "CustomEnglish.nsh" (я также приложил CustomEnglish.nsh для справки)
Пожалуйста, помогите мне, почему пользовательский интерфейс приложения не отображается на немецком языке?
Ниже приведен полный код:
!include "MUI2.nsh"
!include x64.nsh
!include WinVer.nsh
Name "Millinnium 4.0"
OutFile "PCPE_4.0.1.exe"
; The default installation directory in the path C:\Program Files\APC\Millinnium
InstallDir "$PROGRAMFILES32\APC\Millinnium"
InstallDirRegKey HKLM "Software\APC\Millinnium" "Install_Dir"
RequestExecutionLevel admin
;RequestExecutionLevel user
; Below is the include file to check the conditions (If and else)
!include LogicLib.nsh
;Customizing the Welcome Text
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "C:\Program Files (x86)\NSIS\Docs\Modern UI\license.rtf"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!include "CustomEnglish.nsh"
!include "CustomGerman.nsh"
!include "CustomItalian.nsh"
!include "CustomFrench.nsh"
;--------------------------------
;Languages
;!insertmacro MUI_LANGUAGE "English" ; The first language is the default language
;--------------------------------
; The stuff to install
Section "Millinnium (required)"
SectionIn RO
SetOutPath $INSTDIR
; Registry Entries for the 4.01.00 Folder
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00" "AppName" "EMR.exe"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00" "InstallPath" "C:\Program Files\APC\Millinnium\"
${If} ${RunningX64}
MessageBox MB_OK "64-bit windows"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00" "InstallPath" "C:\Program Files (x86)\APC\Millinnium\"
${Else}
MessageBox MB_OK "32-bit windows"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00" "InstallPath" "C:\Program Files\APC\Millinnium\"
${EndIf}
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00" "ResourceFile" "res.dll"
WriteRegDWORD HKLM "SOFTWARE\APC\Millinnium\4.01.00" "UpdateProduct" "0"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00" "Version" "4.0.1"
; Adding Registry entries under "Dialog"
WriteRegDWORD HKLM "SOFTWARE\APC\Millinnium\4.01.00\Dialog" "AppDataCollectionDlg" "0"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00\Dialog" "ReplaceBatteryWebPage" "http://www.APC.com/tools/upgrade_selector/index.cfm?Localize=true"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00\Dialog" "UpgradeUpsUrl" "http://www.APC.com/tools/upgrade_selector/index.cfm?Localize=true"
; Adding Registry entries under "EventLogging"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00\EventLogging" "ImagePath" "C:\Program Files\APC\Millinnium\eventlog.dat"
; Adding Registry entries under "Notifications"
WriteRegDWORD HKLM "SOFTWARE\APC\Millinnium\4.01.00\Notification" "Notification Sounds Enabled" "1"
; Adding Registry entries under "Service"
WriteRegStr HKLM "SOFTWARE\APC\Millinnium\4.01.00\Service" "Image" "mainserv.exe"
${If} ${RunningX64}
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "Display" "C:\Program Files (x86)\APC\Millinnium\DataCollectionLauncher.exe"
${Else}
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "Display" "C:\Program Files\APC\Millinnium\DataCollectionLauncher.exe"
${EndIf}
WriteUninstaller "uninstall.exe"
System::Call 'KERNEL32::AddDllDirectory(w "$INSTDIR")'
File "C:\Desktop\Common\mainserv.exe"
File "C:\Desktop\Common\Microsoft.VC80.CRT.manifest"
File "C:\Desktop\Common\MsgDll.dll"
File "C:\Desktop\Common\msvcm80.dll"
File "C:\Desktop\Common\msvcp80.dll"
File "C:\Desktop\Common\msvcr80.dll"
File "C:\Desktop\Common\ntutil.dll"
File "C:\Desktop\Common\NTUtil64.exe"
File "C:\Desktop\Common\PCPELog.txt"
File "C:\Desktop\Common\PCPELogger.dll"
${If} $Language == 1033 ; English Locale(1033)
File "C:\Desktop\English\license.rtf"
File "C:\Desktop\English\APC PCPE.chm"
File "C:\Desktop\English\AllowStandby.reg"
File "C:\Desktop\English\pchuteres.dll"
File "C:\Desktop\English\relnotes.txt"
File "C:\Desktop\English\res.dll"
${ElseIf} $Language = 1036 ;French Locale(1036)
File "C:\Desktop\French\license.rtf"
File "C:\Desktop\French\APC PCPE.chm"
File "C:\Desktop\French\AllowStandby.reg"
File "C:\Desktop\French\pchuteres.dll"
File "C:\Desktop\French\relnotes.txt"
File "C:\Desktop\French\res.dll"
${ElseIf} $Language = 1031 ;German Locale(1031)
File "C:\Desktop\German\license.rtf"
File "C:\Desktop\German\APC PCPE.chm"
File "C:\Desktop\German\AllowStandby.reg"
File "C:\Desktop\German\pchuteres.dll"
File "C:\Desktop\German\relnotes.txt"
File "C:\Desktop\German\res.dll"
${ElseIf} $Language = 1040 ;Italian Locale(1040)
File "C:\Desktop\Italian\license.rtf"
File "C:\Desktop\Italian\APC PCPE.chm"
File "C:\Desktop\Italian\AllowStandby.reg"
File "C:\Desktop\Italian\pchuteres.dll"
File "C:\Desktop\Italian\relnotes.txt"
File "C:\Desktop\Italian\res.dll"
${EndIf}
SectionEnd
;--------------------------------
Section "Uninstall"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APC"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APC\Millinnium"
DeleteRegKey HKLM "SOFTWARE\APC\Millinnium"
DeleteRegKey HKLM "SOFTWARE\APC"
SectionEnd
CustomEnglish.nsh
!insertmacro MUI_LANGUAGE "English"
!define ApplicationName "Millinnium"
LangString welcometitle ${LANG_ENGLISH} "Welcome to the ${ApplicationName} Setup Wizard"
LangString welcometext ${LANG_ENGLISH} "The Setup Wizard will install ${ApplicationName} on$\r$\nyour computer. Click Next to continue or Cancel to exit the$\r$\nSetup Wizard."
LangString licensetitle ${LANG_ENGLISH} "End-User License Agreement"
LangString licensesubtitle ${LANG_ENGLISH} "Please read the following license agreement carefully"
LangString licensecheckboxtext ${LANG_ENGLISH} "I &agree to terms in the License Agreement"
LangString mydirtoptext ${LANG_ENGLISH} "Install ${ApplicationName} to:"
LangString mydirtitle ${LANG_ENGLISH} "Destination Folder"
LangString mydirsubtitle ${LANG_ENGLISH} "Click Next to install to the default folder or click Browse to choose another"