Currently working with NSIS to create an installer for my PC game, was wondering if there is a way (some default command) to be able to do the 2 following things :
Prompt the user for confirmation when he uninstalls the game (I am currently doing it manually (AKA messagebox) but my problem is that it's always in English (I pretty much want the message to be localized, am wondering if there is a default option to prompt the user that would be localized by default, like the rest of the installer).
Ask to create desktop shortcut (again, I am doing this using the MUI_FINISHPAGE_SHOWREADME_TEXT, but my text isn't localised)
If there are no default ways of doing this what would be the best way to go to be able to localise those two sentences in my installer ?
There is a uninstall confirm page you can use:
!include MUI2.nsh
...
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
You can localize strings by using LangString
s:
!include MUI2.nsh
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(FinishDeskLnkCheck)"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDeskLnk
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE Swedish
LangString FinishDeskLnkCheck ${LANG_ENGLISH} "Create Desktop shortcut?"
LangString FinishDeskLnkCheck ${LANG_SWEDISH} "Bork Desktop bork bork?"
Function .onInit
!define MUI_LANGDLL_ALWAYSSHOW
!define MUI_LANGDLL_ALLLANGUAGES
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
; NOTE: Uninstaller langstring names must be prefixed with "un."
LangString ConfirmUninstMsg ${LANG_ENGLISH} "Kill it?"
LangString ConfirmUninstMsg ${LANG_SWEDISH} "Bork it?"
Function TranslateMsgBoxExample
MessageBox MB_YESNO "$(ConfirmUninstMsg)"
FunctionEnd
Function CreateDeskLnk
; CreateShortcut ...
Call TranslateMsgBoxExample
FunctionEnd
The text on the buttons in a MessageBox is going to use the current users UI language and cannot be translated...