I have created my windows application installer using NSIS 3.02.1.
In language selection textbox, language is display 2 times.
EX.
English/English
Chinese (Simplified) / Hanyu (Jiantizi)
Russian / Russkij...
In my previous setup, which was build using NSIS 2.46 this language setup is looks like :
English
Chinese
Russian...
I don't want to change this in my language selection setup. How can I achieve language selection setup as define in NSIS 2.46 in NSIS 3.02.1?
If you still support Windows 95/98/ME then I would recommend that you use NSIS v2.51, it has all the security updates from NSIS v3 and better language support in the language selection dialog.
If you only support newer versions of Windows then you should add Unicode True to your script, this will display the native name of the language in the language selection dialog and all languages are supported on all systems.
If you insist on creating ANSI installers with NSIS v3 then you can use the undocumented LANGFILE_LANGDLL_FMT define:
OutFile test.exe
RequestExecutionLevel user
!define LANGFILE_LANGDLL_FMT "%NATIVEASCIINAME%" ; %NATIVENAME% can also be used but it will display ? in some cases.
!include "MUI2.nsh"
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "SimpChinese"
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
Section
SectionEnd
Related
I want to create a Suite installer for the various application we develop. The structure is as follows:
Application A
Requires no driver installation
Application B
Requires driver 1 and 2
Application C
Requires driver 2 and 3
The user has the option to install any application he wants, or multiple. I know how to use Sections for this. This will work fine if the user selects only Application A, or Application A with either B or C. However, if the user selects Application B and C, I would like to avoid that driver 2 will be prompted to install twice.
Is there a way to achieve this? For instance, is it possible to know when the section for Application C is executed, that the section for Application B has already been executed, and that driver 2 does not need to be installed again?
There are probably many ways to handle this, one is to put the driver in a hidden section that you make sure is in the correct state:
!include LogicLib.nsh
!include Sections.nsh
!include x64.nsh
Page Components
Page Directory
Page InstFiles
Section "-Driver2" SID_DRIVER2
${If} ${IsNativeAMD64}
; Install AMD64 64-bit driver/library
${ElseIf} ${IsNativeARM64}
; Install ARM64 64-bit driver/library
${ElseIf} ${IsNativeIA32}
; Install i386 32-bit driver/library
${Else}
Abort "Unsupported CPU architecture!"
${EndIf}
SectionEnd
Section "App B" SID_APPB
SectionEnd
Section /o "App C" SID_APPC
SectionEnd
Function .onSelChange
${If} ${SectionIsSelected} ${SID_APPB}
${OrIf} ${SectionIsSelected} ${SID_APPC}
!insertmacro SelectSection ${SID_DRIVER2}
${Else}
!insertmacro UnselectSection ${SID_DRIVER2}
${EndIf}
FunctionEnd
Function .onInit
Call .onSelChange ; Make sure things are configured correctly in silent installers
FunctionEnd
How to override info text on uninstaller welcome page (MUI_UNPAGE_WELCOME)?
I used MUI_TEXT_WELCOME_INFO_TEXT for installer welcome page. But I cannot find solution for uninstaller.
MUI_TEXT_WELCOME_INFO_TEXT is not documented as something you can set.
The MUI documentation tells you which defines you can set and where they apply:
Page settings apply to a single page and should be set before inserting a page macro. The same settings can be used for installer and uninstaller pages.
!include MUI2.nsh
!define MUI_WELCOMEPAGE_TEXT "Blahblah install $(^NameDA).$\r$\n$\r$\nBlah blah blah"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!define MUI_WELCOMEPAGE_TEXT "Blahblah uninstall $(^NameDA).$\r$\n$\r$\nBlah blah blah"
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
How to show the End-User License Agreement ("EULA") in the license agreement screen based on the language or locale.
Below is the line of code to show the license agreement in the License Agreement screen. But it is showing only in English.
!insertmacro MUI_PAGE_LICENSE "C:\Program Files (x86)\NSIS\Docs\Modern UI\license.rtf"
I placed all other language license.rtf files in a common folder. And then when i am trying to write
${If} $Language == 1033
!insertmacro MUI_PAGE_LICENSE "C:\Program Files (x86)\NSIS\Docs\Modern UI\license.rtf"
${EndIf}
It is showing the compilation error "Error: command StrCmp not valid outside Section or Function"
The MUI documentation tells you what to do:
For a license text in multiple languages, LicenseLangString can be used. Refer the NSIS Users Manual for more information about installers with multiple languages.
And the NSIS Users Manual says:
LicenseLangString license ${LANG_ENGLISH} license-english.txt
LicenseLangString license ${LANG_FRENCH} license-french.txt
LicenseLangString license ${LANG_GERMAN} license-german.txt
LicenseData $(license)
For MUI you just point the MUI license page to your LicenseLangString:
!include MUI2.nsh
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(translatedlicensefile)
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
LicenseLangString translatedlicensefile ${LANG_ENGLISH} "lic-eng.txt"
!insertmacro MUI_LANGUAGE Swedish
LicenseLangString translatedlicensefile ${LANG_SWEDISH} "lic-swe.txt"
As part of my project, when I customize the bitmap image in NSIS installer Welcome screen the updated bitmap image is not reflecting.
I used the below line to change the bitmap image:
!define MUI_DEFAULT_MUI_WELCOMEFINISHPAGE_BITMAP "E:\Source\NULLSOFT\src\Bitmaps\dlgbmp.bmp"
Below is the code snippet:
;Pages
;Customizing the bitmap image
!define MUI_DEFAULT_MUI_WELCOMEFINISHPAGE_BITMAP "E:\Source\NULLSOFT\src\Bitmaps\dlgbmp.bmp"
!insertmacro MUI_PAGE_WELCOME
;Languages
!insertmacro MUI_LANGUAGE "English" ; The first language is the default language
!insertmacro MUI_LANGUAGE "French"
Do we need to do any additional changes to update the new bitmap? Please help me.
There is no define named MUI_DEFAULT_MUI_WELCOMEFINISHPAGE_BITMAP, see the MUI documentation for valid defines.
In you case the define is named MUI_WELCOMEFINISHPAGE_BITMAP:
!include MUI2.nsh
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
I would like to build an installer for my application using NSIS, but I faced a problem on the finish page. It looks like a big white rectangle around a checkbox. The rectangle cuts the 'Nullsoft Install System v3.03' subtitle. Here it is a screenshot:
Here it is a code:
!include "MUI2.nsh"
Name "My cool app"
OutFile "MyCoolAppInstaller.exe"
InstallDir "C:\MyCoolApp"
!define MUI_FINISHPAGE_RUN "$INSTDIR\app.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Run App now"
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
Section
SetOutPath "$INSTDIR"
File app.exe
File smth.res
SectionEnd
Does anybody know how to fix it?
You need to add at least one language after the page macros:
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\app.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Run App now"
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
Adding a language will finalize some of the things in the UI and it does not look correct without it.