Hi everyone 🙂 I have a problem when I want to add some new texts in second welcome page. I have a message: "LangString "MUI_UNTEXT_WELCOME_INFO_TITLE2" is not set in language table of language Polish". I've added MUI_LANGUAGE after MUI_PAGE_*, but it still occurs. Even if i just change name from MUI_TEXT_WELCOME_INFO_TITLE into MUI_TEXT_WELCOME_INFO_TITLE2 it happens.
Please, help 🙂
Problem with LangString is not set in language table...
10 posts
Please post some example code...
Code is very long, this is the installer to Gothic 2 modification, the part of it:
; Konfiguration (Installer)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie instalacji patcha do moda $(^Name).\r\n\r\nPrzed przystąpieniem do instalacji, zalecane jest zamknięcie wszystkich procesów systemowych działających w tle systemu Windows.\r\n\r\n$_CLICK"
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Installer)
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_WELCOME2
!insertmacro MUI_PAGE_LICENSE ".\setup\licence.rtf"
Page custom PageReinstall PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Konfiguration (Uninstaller)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie instalacji patcha do moda $(^Name).\r\n\r\nProszę wyłączyć Gothic II oraz związane z nim narzędzia,\r\nprzed przystąpieniem do deinstalacji.\r\n\r\n$_CLICK"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Uninstaller)
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; Setup-Sprache
!insertmacro MUI_LANGUAGE "Polish"
; Reservierte Dateien
ReserveFile "setup.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
But the problem is I can't add any new texts to file Polish.nsh, becuse there is this error.
; Konfiguration (Installer)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie instalacji patcha do moda $(^Name).\r\n\r\nPrzed przystąpieniem do instalacji, zalecane jest zamknięcie wszystkich procesów systemowych działających w tle systemu Windows.\r\n\r\n$_CLICK"
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Installer)
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_WELCOME2
!insertmacro MUI_PAGE_LICENSE ".\setup\licence.rtf"
Page custom PageReinstall PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Konfiguration (Uninstaller)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie instalacji patcha do moda $(^Name).\r\n\r\nProszę wyłączyć Gothic II oraz związane z nim narzędzia,\r\nprzed przystąpieniem do deinstalacji.\r\n\r\n$_CLICK"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Uninstaller)
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; Setup-Sprache
!insertmacro MUI_LANGUAGE "Polish"
; Reservierte Dateien
ReserveFile "setup.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
But the problem is I can't add any new texts to file Polish.nsh, becuse there is this error.
What is MUI_PAGE_WELCOME2? That is not a standard macro. You need to post example code that actually compiles...
MUI_PAGE_WELCOME2 is my additional page, because I want to have one more to give some information. So what should I do if I want to have such new page in installator?
Its script:
!macro MUI_PAGE_WELCOME2
!verbose push
!verbose ${MUI_VERBOSE}
!insertmacro MUI_PAGE_INIT
!insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE
!insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE2)"
!insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT2)"
!ifndef MUI_VAR_HWND
Var MUI_HWND
!define MUI_VAR_HWND
!endif
PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
PageExEnd
!insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT
!verbose pop
!macroend
and
!macro MUI_UNPAGE_WELCOME2
!verbose push
!verbose ${MUI_VERBOSE}
!insertmacro MUI_UNPAGE_INIT
!insertmacro MUI_PAGE_WELCOME2
!insertmacro MUI_UNPAGE_END
!verbose pop
!macroend
and of course in setup: !insertmacro MUI_PAGE_WELCOME2
Its script:
!macro MUI_PAGE_WELCOME2
!verbose push
!verbose ${MUI_VERBOSE}
!insertmacro MUI_PAGE_INIT
!insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE
!insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE2)"
!insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT2)"
!ifndef MUI_VAR_HWND
Var MUI_HWND
!define MUI_VAR_HWND
!endif
PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
PageExEnd
!insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT
!verbose pop
!macroend
and
!macro MUI_UNPAGE_WELCOME2
!verbose push
!verbose ${MUI_VERBOSE}
!insertmacro MUI_UNPAGE_INIT
!insertmacro MUI_PAGE_WELCOME2
!insertmacro MUI_UNPAGE_END
!verbose pop
!macroend
and of course in setup: !insertmacro MUI_PAGE_WELCOME2
You need to set the custom strings (the compiler already told you that the strings do not exist):
!insertmacro MUI_LANGUAGE "Polish"
LangString MUI_TEXT_WELCOME_INFO_TITLE2 ${LANG_POLISH} "Blah blah blah"
LangString MUI_TEXT_WELCOME_INFO_TEXT2 ${LANG_POLISH} "$(MUI_TEXT_WELCOME_INFO_TEXT) "Blah blah blah"
It didn't work (there were some mistakes), but I've solved it in another way. I've defined these texts in setup as default and then I've modified texts in polish.nsh into mine and it works now 🙂
But I have another question, can I add a hyperlink here?
${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "More information on http://www.zlotewrota.org/eng/support-us/"
But I have another question, can I add a hyperlink here?
${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "More information on http://www.zlotewrota.org/eng/support-us/"
No, you would need to add a separate link control...
Okay, thanks.
Well, I was trying to add this hiperlink in different ways, but there are always some mistakes... Maybe someone has any idea how to add it into such installer?
;===============================================================================
;
; G2MDK - DemoMod Setup-Script
;
; System: NSIS 2.0 http://nsis.sf.net/
; Editor: HMNE 2.0 http://hmne.sf.net/
;
;===============================================================================
; Kompressionseinstellungen
CRCCheck force
;SetCompressor lzma
;SetCompressorDictSize 128 ; LZMA-Speicherverbrauch, siehe Tabelle
; DictSize Compress Decomp
; 8 MB 141 MB 10 MB (default)
; 12 MB 179 MB 14 MB
; 16 MB 217 MB 18 MB
; 24 MB 293 MB 26 MB
; 32 MB 369 MB 35 MB
; 48 MB 521 MB 50 MB
; 64 MB 673 MB 66 MB
; 96 MB 977 MB 98 MB
; 128 MB 1281 MB 130 MB
; 192 MB 1889 MB 194 MB
;!packhdr "packhdr.tmp" "upx.exe --best packhdr.tmp" ; http://upx.sf.net/
; Definitionen
!define MUI_ICON "ZW.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "ZW3.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "ZW3.bmp"
; TODO: Version der Modifikation
!define VER_MAJOR 1 ; Major Version
!define VER_MINOR 05 ; Minor Version
!define VER_PATCH 1 ; Patch-Version (1=a, ...)
!define VER_FLAGS 0 ; Sprachversion
!define VER_FILE "${VER_MAJOR}.${VER_MINOR}"
!define VER_TEXT "${VER_MAJOR}.${VER_MINOR}"
; TODO: Eigenschaften der Modifikation
!define MOD_FILE "ZW_Patch" ; Mod-Dateiname (KEINE Leer- oder Sonderzeichen!)
!define MOD_NAME "Złote Wrota Patch" ; Mod-Titel
!define MOD_COPY "Copyright © 2004, Złote Wrota Team" ; Mod-Copyright
!define MOD_COMP "Złote Wrota Team" ; Mod-Herausgeber
!define MOD_LINK "http://www.zlotewrota.org" ; Herausgeber-Link
!define MOD_HELP "http://www.zlotewrota.org" ; Support-Link
;===============================================================================
;
; MUI
;
!include "MUI.nsh"
Name "${MOD_NAME} ${VER_TEXT}"
OutFile "${MOD_FILE}-${VER_FILE}.exe"
InstallDir "$PROGRAMFILES\JoWood\Gothic II\"
!define MOD_RKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MOD_NAME}"
InstallDirRegKey HKLM "${MOD_RKEY}" "InstallLocation"
AllowRootDirInstall true
; Konfiguration (Installer)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TITLE "Witamy w kreatorze instalacji programu $(^NameDA)"
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie instalacji patcha do moda $(^Name).\r\n\r\nPrzed przystąpieniem do instalacji, zalecane jest zamknięcie wszystkich procesów systemowych działających w tle systemu Windows.\r\n\r\n$_CLICK"
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Installer)
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_WELCOME2
!insertmacro MUI_PAGE_LICENSE ".\setup\licence.rtf"
Page custom PageReinstall PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Konfiguration (Uninstaller)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TITLE "Witamy w deinstalatorze $(^NameDA)"
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie deinstalacji patcha do moda $(^Name).\r\n\r\nProszę wyłączyć Gothic II oraz związane z nim narzędzia,\r\nprzed przystąpieniem do deinstalacji.\r\n\r\n$_CLICK"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Uninstaller)
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_WELCOME2
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; Setup-Sprache
!insertmacro MUI_LANGUAGE "Polish"
; Reservierte Dateien
ReserveFile "setup.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
;===============================================================================
;
; Installer
;
; Setup.exe Versionsinformationen (Sprache = MUI_LANGUAGE)
VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.${VER_FLAGS}"
VIAddVersionKey "CompanyName" "${MOD_COMP}"
VIAddVersionKey "FileVersion" "${VER_TEXT}"
VIAddVersionKey "LegalCopyright" "${MOD_COPY}"
VIAddVersionKey "FileDescription" "${MOD_NAME}"
VIAddVersionKey "OriginalFilename" "${MOD_FILE}-${VER_FILE}.exe"
LangString NameInstFull ${LANG_POLISH} "Pełna instalacja"
InstType $(NameInstFull)
Insttype "W przypadku problemów na Windows 7 (należy uruchomić Gothic II w trybie zgodnie z Windows XP SP3)"
Insttype "W przypadku problemów na Windows 8 (link do strony z pomocą bądź zajrzyj do pliku Dokumentacja Złotych Wrót)"
!include ".\setup\g2mod.nsh"
;-------------------------------------------------------------------------------
;
; Init (nicht angezeigt)
;
; Installer
Section -pre
Push $R0
SetDetailsPrint none
StrCpy $R0 "${MOD_RKEY}"
; Setup-Parameter in die Registrierung schreiben
ClearErrors
WriteRegExpandStr HKLM $R0 "InstallLocation" $INSTDIR
IfErrors "" write
MessageBox MB_OK|MB_ICONSTOP "Wystąpił błąd podczas instalacji.$\r$\nUpewnij się, że konto użytkownika ma odpowiednie uprawnienia.$\r$\n$\r$\n(HKLM\$R0)"
Pop $R0
Abort
write:
WriteRegDWORD HKLM $R0 "VersionMajor" ${VER_MAJOR}
WriteRegDWORD HKLM $R0 "VersionMinor" ${VER_MINOR}
WriteRegDWORD HKLM $R0 "VersionPatch" ${VER_PATCH}
WriteRegDWORD HKLM $R0 "VersionFlags" ${VER_FLAGS}
;WriteRegStr HKLM $R0 "DisplayIcon" "$INSTDIR\System\ZW.ico"
WriteRegStr HKLM $R0 "DisplayIcon" "$INSTDIR\System\Gothic2.exe,0"
WriteRegStr HKLM $R0 "DisplayName" "${MOD_NAME}"
WriteRegStr HKLM $R0 "DisplayVersion" "${VER_TEXT}"
WriteRegDWORD HKLM $R0 "NoModify" 1
WriteRegDWORD HKLM $R0 "NoRepair" 1
WriteRegExpandStr HKLM $R0 "UninstallString" "$INSTDIR\${MOD_FILE}-uninst.exe"
WriteRegStr HKLM $R0 "Publisher" "${MOD_COMP}"
WriteRegStr HKLM $R0 "URLInfoAbout" "${MOD_LINK}"
WriteRegStr HKLM $R0 "HelpLink" "${MOD_HELP}"
Pop $R0
SectionEnd
;-------------------------------------------------------------------------------
;
; Modifikation
;
; Installer
LangString NameSecModFiles ${LANG_POLISH} "${MOD_NAME}"
LangString TextSecModFiles ${LANG_POLISH} "Instalowanie ${MOD_NAME}..."
Section !$(NameSecModFiles) SecModFiles
SectionIn RO ; nicht abwählbar
SetDetailsPrint textonly
DetailPrint $(TextSecModFiles)
SetDetailsPrint listonly
SetOverwrite on
; Installiere Mod-Konfiguration
SetOutPath "$INSTDIR\"
File ".\install\*.*"
SetOutPath "$INSTDIR\System"
File ".\install\System\ZloteWrota.ini"
; Installiere Mod-Volume
SetOutPath "$INSTDIR\Data\modvdf"
File ".\install\Data\modvdf\${MOD_FILE}.mod"
; Eventuelles Mod-Volume in /Data entfernen
!insertmacro g2mod_DeleteFile "$INSTDIR\Data\${MOD_FILE}.mod"
SectionEnd
Section "W przypadku problemów na Windows 7 (należy uruchomić Gothic II w trybie zgodnie z Windows XP SP3)" SEC_GS
SetOverwrite on
SetDetailsPrint none
SetShellVarContext current
SetOutPath "$INSTDIR\System"
File ".\install\Win7\*.*"
SectionEnd
Section "W przypadku problemów na Windows 8 (link do strony z pomocą bądź zajrzyj do pliku Dokumentacja Złotych Wrót)" SectionX
ExecShell "open" "http://themodders.org/index.php?topic=22046.0"
SectionEnd
; Uninstaller
Section !un.$(NameSecModFiles) unSecModFiles
SectionIn RO ; nicht abwählbar
; Mod-Volume und Mod-Volume-Map entfernen
!insertmacro g2mod_DeleteFile "$INSTDIR\vdfs_${MOD_FILE}.dmp"
!insertmacro g2mod_DeleteFile "$INSTDIR\Data\${MOD_FILE}.mod"
!insertmacro g2mod_DeleteFile "$INSTDIR\Data\modvdf\${MOD_FILE}.mod"
!insertmacro g2mod_DeleteFile "$INSTDIR\_work\Data\Video\Credits_ZW2.bik"
;!insertmacro g2mod_DeleteFile "$DESKTOP\${MOD_NAME}.lnk"
;!insertmacro g2mod_DeleteFile "$INSTDIR\System\Zlotewrota.rtf"
;!insertmacro g2mod_DeleteFile "$INSTDIR\System\ZW.ico"
; /Data/modvdf wird nur entfernt, wenn es leer ist
;!insertmacro g2mod_RemoveDirectory "$INSTDIR\Data\modvdf"
; Mod-Konfiguration entfernen
!insertmacro g2mod_DeleteFile "$INSTDIR\System\ZloteWrota.ini"
; Einträge im Startmenü entfernen
SetShellVarContext current
;!insertmacro g2mod_DeleteFile "$SMPROGRAMS\JoWood\Gothic II\Modyfikacje\${MOD_NAME}.lnk"
;!insertmacro g2mod_DeleteFile "$SMPROGRAMS\JoWood\Gothic II\Modyfikacje\${MOD_NAME} odinstalowanie.lnk"
; Werden nur entfernt, falls die Verzeihcnisse leer sind...
;!insertmacro g2mod_RemoveDirectory "$SMPROGRAMS\JoWood\Gothic II\Modyfikacje"
;!insertmacro g2mod_RemoveDirectory "$SMPROGRAMS\JoWood\Gothic II"
;!insertmacro g2mod_RemoveDirectory "$SMPROGRAMS\JoWood"
DeleteRegKey HKLM "${MOD_RKEY}"
; Uninstaller entfernen
Delete "$INSTDIR\${MOD_FILE}-uninst.exe"
SectionEnd
; Installer
Section -post
SetDetailsPrint none
; Uninstaller schreiben
Delete "$INSTDIR\${MOD_FILE}-uninst.exe"
WriteUninstaller "$INSTDIR\${MOD_FILE}-uninst.exe"
SectionEnd
; Uninstaller
Section -un.post
SetDetailsPrint none
; Registrierungsdaten entfernen
DeleteRegKey HKLM "${MOD_RKEY}"
; Uninstaller entfernen
Delete "$INSTDIR\${MOD_FILE}-uninst.exe"
SectionEnd
;===============================================================================
;
; Player-Kit
;
Section -g2mpk
SetOverwrite on
SetDetailsPrint none
SetShellVarContext current
!insertmacro g2mod_InstallPlayerKit
SectionEnd
;===============================================================================
;
; Callback-Funktionen
;
; Installer (Init)
Function .onInit
Push $R0
SetCurInstType 0
;!insertmacro MUI_INSTALLOPTIONS_EXTRACT "setup.ini"
; Kein 'unsichtbares' Setup
SetSilent normal
; $INSTDIR bereits gültig?
IfFileExists "$INSTDIR\System\Gothic2.exe" done
; Sonst Add-ON Installation suchen (Registrierung)
Call g2mod_GetInstallLocation
Pop $R0
StrCmp $R0 "" done
; Übernehmen
StrCpy $INSTDIR $R0
done:
Pop $R0
FunctionEnd
; Uninstaller (Init)
Function un.onInit
Push $R0
; $INSTDIR gültig?
IfFileExists "$INSTDIR\System\Gothic2.exe" done
; Mod-Installation suchen (Registrierung)
ReadRegStr $R0 HKLM "${MOD_RKEY}" "InstallLocation"
StrCmp $R0 "" wrong
StrCpy $INSTDIR $R0
IfFileExists "$INSTDIR\System\Gothic2.exe" done
; Nicht gefunden...
wrong:
MessageBox MB_YESNO|MB_ICONQUESTION "Katalog instalacji wydaje się być niepoprawny.$\r$\nCzy chcesz odinstalować mimo to?" IDYES done
Pop $R0
Abort
done:
Pop $R0
FunctionEnd
; Reinstall
LangString TextReinstTitle ${LANG_POLISH} "Poprzednia instalacja"
LangString TextReinstHead1 ${LANG_POLISH} "Proszę wybrać, jak $(^Name) zostaną zainstalowane."
LangString TextReinstOpt1A ${LANG_POLISH} "Przed deinstalacją"
LangString TextReinstOpt1B ${LANG_POLISH} "Nie odinstalowano"
LangString TextReinstHead2 ${LANG_POLISH} "Wybierz opcję konserwacji"
LangString TextReinstOpt2A ${LANG_POLISH} "Ponowna instalacja"
LangString TextReinstOpt2B ${LANG_POLISH} "$(^Name) odinstalowanie"
LangString TextReinstWrong ${LANG_POLISH} "Niezgodna wersja jest już zainstalowana!\r\nJeśli chcesz zainstalować tę wersję,\r\nnależy najpierw odinstalować bieżącą."
LangString TextReinstOlder ${LANG_POLISH} "W systemie jest zainstalowana starsza wersja.\r\nZaleca się odinstalowanie bieżącej wersji."
LangString TextReinstNewer ${LANG_POLISH} "W systemie jest już zainstalowana nowsza wersja.!\r\nNie zaleca się odinstalowania bieżącej wersji. Jeśli chcesz zainstalować tę wersję, należy najpierw odinstalować bieżącą."
LangString TextReinstEqual ${LANG_POLISH} "$(^Name) są instalowane."
Function PageReinstall
; Installationsverzeichnis lesen
ReadRegStr $R0 HKLM "${MOD_RKEY}" "InstallLocation"
StrCmp $R0 "" 0 +2
Abort
; Version überprüfen
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionFlags"
IntCmp $R0 ${VER_FLAGS} major wrong wrong
major:
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionMajor"
IntCmp $R0 ${VER_MAJOR} minor older newer
minor:
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionMinor"
IntCmp $R0 ${VER_MINOR} patch older newer
patch:
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionPatch"
IntCmp $R0 ${VER_PATCH} equal older newer
wrong:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstWrong)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt1A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt1B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead1)"
StrCpy $R0 "1"
Goto start
older:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstOlder)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt1A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt1B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead1)"
StrCpy $R0 "1"
Goto start
newer:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstNewer)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt1A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt1B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead1)"
StrCpy $R0 "1"
Goto start
equal:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstEqual)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt2A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt2B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead2)"
StrCpy $R0 "2"
start:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "setup.ini"
FunctionEnd
Function PageLeaveReinstall
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "setup.ini" "Field 2" "State"
StrCmp $R0 "1" 0 +2
StrCmp $R1 "1" inst done
StrCmp $R0 "2" 0 +3
StrCmp $R1 "1" done inst
inst:
HideWindow
ReadRegStr $R1 HKLM "${MOD_RKEY}" "UninstallString"
ClearErrors
ExecWait '$R1 _?=$INSTDIR'
IfErrors nope
IfFileExists $R1 "" nope
Delete $R1
nope:
StrCmp $R0 "2" 0 +2
Quit
BringToFront
done:
FunctionEnd
; Installer (Verzeichnisprüfung)
Var VerifyMessageOnce
Function .onVerifyInstDir
; Version 2.6 deutsch installiert ?
!insertmacro g2mod_IfInstallVersion $INSTDIR "2.6.0.0" done
; Basisversion 2.6 ?
!insertmacro g2mod_IfInstallVersionBase $INSTDIR "2.6" code
Goto nope
code:
; Deutsche Version ?
!insertmacro g2mod_IfInstallVersionCode $INSTDIR 0 done
; Keine 2.6-er (deutsch)...
nope:
; Meldung nur einmalig anzeigen
StrCmp $VerifyMessageOnce "done" +3
MessageBox MB_OK|MB_ICONINFORMATION "Proszę wybrać ścieżkę, w której zainstalowany jest 'Gothic II - Noc Kruka' 2.6."
StrCpy $VerifyMessageOnce "done"
Abort
done:
FunctionEnd
I want to add this somewhere in MUI_PAGE_WELCOME2. I've found how to make such hyperlink, but I don't know how to implement it into mine installer:
!include "nsDialogs.nsh"
!include "winmessages.nsh"
!include "logiclib.nsh"
OutFile "test.exe"
Page Custom pre
var dialog
var hwnd
Function pre
nsDialogs::Create 1018
Pop $dialog
${NSD_CreateLink} 0 0 40% 6% "Group 1, Radio 1"
Pop $hwnd
${NSD_AddStyle} $hwnd ${WS_GROUP}
${NSD_OnClick} $hwnd Group1Radio1Click
${NSD_CreateLink} 0 12% 40% 6% "Group 1, Radio 2"
Pop $hwnd
${NSD_OnClick} $hwnd Group1Radio2Click
nsDialogs::Show
FunctionEnd
Function Group1Radio1Click
Pop $hwnd
ExecShell "open" "http://zlotewrota.org"
FunctionEnd
Function Group1Radio2Click
Pop $hwnd
MessageBox MB_OK "onClick:Group1Radio2"
FunctionEnd
Section ""
SectionEnd
;===============================================================================
;
; G2MDK - DemoMod Setup-Script
;
; System: NSIS 2.0 http://nsis.sf.net/
; Editor: HMNE 2.0 http://hmne.sf.net/
;
;===============================================================================
; Kompressionseinstellungen
CRCCheck force
;SetCompressor lzma
;SetCompressorDictSize 128 ; LZMA-Speicherverbrauch, siehe Tabelle
; DictSize Compress Decomp
; 8 MB 141 MB 10 MB (default)
; 12 MB 179 MB 14 MB
; 16 MB 217 MB 18 MB
; 24 MB 293 MB 26 MB
; 32 MB 369 MB 35 MB
; 48 MB 521 MB 50 MB
; 64 MB 673 MB 66 MB
; 96 MB 977 MB 98 MB
; 128 MB 1281 MB 130 MB
; 192 MB 1889 MB 194 MB
;!packhdr "packhdr.tmp" "upx.exe --best packhdr.tmp" ; http://upx.sf.net/
; Definitionen
!define MUI_ICON "ZW.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "ZW3.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "ZW3.bmp"
; TODO: Version der Modifikation
!define VER_MAJOR 1 ; Major Version
!define VER_MINOR 05 ; Minor Version
!define VER_PATCH 1 ; Patch-Version (1=a, ...)
!define VER_FLAGS 0 ; Sprachversion
!define VER_FILE "${VER_MAJOR}.${VER_MINOR}"
!define VER_TEXT "${VER_MAJOR}.${VER_MINOR}"
; TODO: Eigenschaften der Modifikation
!define MOD_FILE "ZW_Patch" ; Mod-Dateiname (KEINE Leer- oder Sonderzeichen!)
!define MOD_NAME "Złote Wrota Patch" ; Mod-Titel
!define MOD_COPY "Copyright © 2004, Złote Wrota Team" ; Mod-Copyright
!define MOD_COMP "Złote Wrota Team" ; Mod-Herausgeber
!define MOD_LINK "http://www.zlotewrota.org" ; Herausgeber-Link
!define MOD_HELP "http://www.zlotewrota.org" ; Support-Link
;===============================================================================
;
; MUI
;
!include "MUI.nsh"
Name "${MOD_NAME} ${VER_TEXT}"
OutFile "${MOD_FILE}-${VER_FILE}.exe"
InstallDir "$PROGRAMFILES\JoWood\Gothic II\"
!define MOD_RKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MOD_NAME}"
InstallDirRegKey HKLM "${MOD_RKEY}" "InstallLocation"
AllowRootDirInstall true
; Konfiguration (Installer)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TITLE "Witamy w kreatorze instalacji programu $(^NameDA)"
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie instalacji patcha do moda $(^Name).\r\n\r\nPrzed przystąpieniem do instalacji, zalecane jest zamknięcie wszystkich procesów systemowych działających w tle systemu Windows.\r\n\r\n$_CLICK"
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Installer)
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_WELCOME2
!insertmacro MUI_PAGE_LICENSE ".\setup\licence.rtf"
Page custom PageReinstall PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Konfiguration (Uninstaller)
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TITLE "Witamy w deinstalatorze $(^NameDA)"
!define MUI_WELCOMEPAGE_TEXT "Witaj w asystencie deinstalacji patcha do moda $(^Name).\r\n\r\nProszę wyłączyć Gothic II oraz związane z nim narzędzia,\r\nprzed przystąpieniem do deinstalacji.\r\n\r\n$_CLICK"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_TITLE_3LINES
; Setup-Seiten (Uninstaller)
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_WELCOME2
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; Setup-Sprache
!insertmacro MUI_LANGUAGE "Polish"
; Reservierte Dateien
ReserveFile "setup.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
;===============================================================================
;
; Installer
;
; Setup.exe Versionsinformationen (Sprache = MUI_LANGUAGE)
VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.${VER_FLAGS}"
VIAddVersionKey "CompanyName" "${MOD_COMP}"
VIAddVersionKey "FileVersion" "${VER_TEXT}"
VIAddVersionKey "LegalCopyright" "${MOD_COPY}"
VIAddVersionKey "FileDescription" "${MOD_NAME}"
VIAddVersionKey "OriginalFilename" "${MOD_FILE}-${VER_FILE}.exe"
LangString NameInstFull ${LANG_POLISH} "Pełna instalacja"
InstType $(NameInstFull)
Insttype "W przypadku problemów na Windows 7 (należy uruchomić Gothic II w trybie zgodnie z Windows XP SP3)"
Insttype "W przypadku problemów na Windows 8 (link do strony z pomocą bądź zajrzyj do pliku Dokumentacja Złotych Wrót)"
!include ".\setup\g2mod.nsh"
;-------------------------------------------------------------------------------
;
; Init (nicht angezeigt)
;
; Installer
Section -pre
Push $R0
SetDetailsPrint none
StrCpy $R0 "${MOD_RKEY}"
; Setup-Parameter in die Registrierung schreiben
ClearErrors
WriteRegExpandStr HKLM $R0 "InstallLocation" $INSTDIR
IfErrors "" write
MessageBox MB_OK|MB_ICONSTOP "Wystąpił błąd podczas instalacji.$\r$\nUpewnij się, że konto użytkownika ma odpowiednie uprawnienia.$\r$\n$\r$\n(HKLM\$R0)"
Pop $R0
Abort
write:
WriteRegDWORD HKLM $R0 "VersionMajor" ${VER_MAJOR}
WriteRegDWORD HKLM $R0 "VersionMinor" ${VER_MINOR}
WriteRegDWORD HKLM $R0 "VersionPatch" ${VER_PATCH}
WriteRegDWORD HKLM $R0 "VersionFlags" ${VER_FLAGS}
;WriteRegStr HKLM $R0 "DisplayIcon" "$INSTDIR\System\ZW.ico"
WriteRegStr HKLM $R0 "DisplayIcon" "$INSTDIR\System\Gothic2.exe,0"
WriteRegStr HKLM $R0 "DisplayName" "${MOD_NAME}"
WriteRegStr HKLM $R0 "DisplayVersion" "${VER_TEXT}"
WriteRegDWORD HKLM $R0 "NoModify" 1
WriteRegDWORD HKLM $R0 "NoRepair" 1
WriteRegExpandStr HKLM $R0 "UninstallString" "$INSTDIR\${MOD_FILE}-uninst.exe"
WriteRegStr HKLM $R0 "Publisher" "${MOD_COMP}"
WriteRegStr HKLM $R0 "URLInfoAbout" "${MOD_LINK}"
WriteRegStr HKLM $R0 "HelpLink" "${MOD_HELP}"
Pop $R0
SectionEnd
;-------------------------------------------------------------------------------
;
; Modifikation
;
; Installer
LangString NameSecModFiles ${LANG_POLISH} "${MOD_NAME}"
LangString TextSecModFiles ${LANG_POLISH} "Instalowanie ${MOD_NAME}..."
Section !$(NameSecModFiles) SecModFiles
SectionIn RO ; nicht abwählbar
SetDetailsPrint textonly
DetailPrint $(TextSecModFiles)
SetDetailsPrint listonly
SetOverwrite on
; Installiere Mod-Konfiguration
SetOutPath "$INSTDIR\"
File ".\install\*.*"
SetOutPath "$INSTDIR\System"
File ".\install\System\ZloteWrota.ini"
; Installiere Mod-Volume
SetOutPath "$INSTDIR\Data\modvdf"
File ".\install\Data\modvdf\${MOD_FILE}.mod"
; Eventuelles Mod-Volume in /Data entfernen
!insertmacro g2mod_DeleteFile "$INSTDIR\Data\${MOD_FILE}.mod"
SectionEnd
Section "W przypadku problemów na Windows 7 (należy uruchomić Gothic II w trybie zgodnie z Windows XP SP3)" SEC_GS
SetOverwrite on
SetDetailsPrint none
SetShellVarContext current
SetOutPath "$INSTDIR\System"
File ".\install\Win7\*.*"
SectionEnd
Section "W przypadku problemów na Windows 8 (link do strony z pomocą bądź zajrzyj do pliku Dokumentacja Złotych Wrót)" SectionX
ExecShell "open" "http://themodders.org/index.php?topic=22046.0"
SectionEnd
; Uninstaller
Section !un.$(NameSecModFiles) unSecModFiles
SectionIn RO ; nicht abwählbar
; Mod-Volume und Mod-Volume-Map entfernen
!insertmacro g2mod_DeleteFile "$INSTDIR\vdfs_${MOD_FILE}.dmp"
!insertmacro g2mod_DeleteFile "$INSTDIR\Data\${MOD_FILE}.mod"
!insertmacro g2mod_DeleteFile "$INSTDIR\Data\modvdf\${MOD_FILE}.mod"
!insertmacro g2mod_DeleteFile "$INSTDIR\_work\Data\Video\Credits_ZW2.bik"
;!insertmacro g2mod_DeleteFile "$DESKTOP\${MOD_NAME}.lnk"
;!insertmacro g2mod_DeleteFile "$INSTDIR\System\Zlotewrota.rtf"
;!insertmacro g2mod_DeleteFile "$INSTDIR\System\ZW.ico"
; /Data/modvdf wird nur entfernt, wenn es leer ist
;!insertmacro g2mod_RemoveDirectory "$INSTDIR\Data\modvdf"
; Mod-Konfiguration entfernen
!insertmacro g2mod_DeleteFile "$INSTDIR\System\ZloteWrota.ini"
; Einträge im Startmenü entfernen
SetShellVarContext current
;!insertmacro g2mod_DeleteFile "$SMPROGRAMS\JoWood\Gothic II\Modyfikacje\${MOD_NAME}.lnk"
;!insertmacro g2mod_DeleteFile "$SMPROGRAMS\JoWood\Gothic II\Modyfikacje\${MOD_NAME} odinstalowanie.lnk"
; Werden nur entfernt, falls die Verzeihcnisse leer sind...
;!insertmacro g2mod_RemoveDirectory "$SMPROGRAMS\JoWood\Gothic II\Modyfikacje"
;!insertmacro g2mod_RemoveDirectory "$SMPROGRAMS\JoWood\Gothic II"
;!insertmacro g2mod_RemoveDirectory "$SMPROGRAMS\JoWood"
DeleteRegKey HKLM "${MOD_RKEY}"
; Uninstaller entfernen
Delete "$INSTDIR\${MOD_FILE}-uninst.exe"
SectionEnd
; Installer
Section -post
SetDetailsPrint none
; Uninstaller schreiben
Delete "$INSTDIR\${MOD_FILE}-uninst.exe"
WriteUninstaller "$INSTDIR\${MOD_FILE}-uninst.exe"
SectionEnd
; Uninstaller
Section -un.post
SetDetailsPrint none
; Registrierungsdaten entfernen
DeleteRegKey HKLM "${MOD_RKEY}"
; Uninstaller entfernen
Delete "$INSTDIR\${MOD_FILE}-uninst.exe"
SectionEnd
;===============================================================================
;
; Player-Kit
;
Section -g2mpk
SetOverwrite on
SetDetailsPrint none
SetShellVarContext current
!insertmacro g2mod_InstallPlayerKit
SectionEnd
;===============================================================================
;
; Callback-Funktionen
;
; Installer (Init)
Function .onInit
Push $R0
SetCurInstType 0
;!insertmacro MUI_INSTALLOPTIONS_EXTRACT "setup.ini"
; Kein 'unsichtbares' Setup
SetSilent normal
; $INSTDIR bereits gültig?
IfFileExists "$INSTDIR\System\Gothic2.exe" done
; Sonst Add-ON Installation suchen (Registrierung)
Call g2mod_GetInstallLocation
Pop $R0
StrCmp $R0 "" done
; Übernehmen
StrCpy $INSTDIR $R0
done:
Pop $R0
FunctionEnd
; Uninstaller (Init)
Function un.onInit
Push $R0
; $INSTDIR gültig?
IfFileExists "$INSTDIR\System\Gothic2.exe" done
; Mod-Installation suchen (Registrierung)
ReadRegStr $R0 HKLM "${MOD_RKEY}" "InstallLocation"
StrCmp $R0 "" wrong
StrCpy $INSTDIR $R0
IfFileExists "$INSTDIR\System\Gothic2.exe" done
; Nicht gefunden...
wrong:
MessageBox MB_YESNO|MB_ICONQUESTION "Katalog instalacji wydaje się być niepoprawny.$\r$\nCzy chcesz odinstalować mimo to?" IDYES done
Pop $R0
Abort
done:
Pop $R0
FunctionEnd
; Reinstall
LangString TextReinstTitle ${LANG_POLISH} "Poprzednia instalacja"
LangString TextReinstHead1 ${LANG_POLISH} "Proszę wybrać, jak $(^Name) zostaną zainstalowane."
LangString TextReinstOpt1A ${LANG_POLISH} "Przed deinstalacją"
LangString TextReinstOpt1B ${LANG_POLISH} "Nie odinstalowano"
LangString TextReinstHead2 ${LANG_POLISH} "Wybierz opcję konserwacji"
LangString TextReinstOpt2A ${LANG_POLISH} "Ponowna instalacja"
LangString TextReinstOpt2B ${LANG_POLISH} "$(^Name) odinstalowanie"
LangString TextReinstWrong ${LANG_POLISH} "Niezgodna wersja jest już zainstalowana!\r\nJeśli chcesz zainstalować tę wersję,\r\nnależy najpierw odinstalować bieżącą."
LangString TextReinstOlder ${LANG_POLISH} "W systemie jest zainstalowana starsza wersja.\r\nZaleca się odinstalowanie bieżącej wersji."
LangString TextReinstNewer ${LANG_POLISH} "W systemie jest już zainstalowana nowsza wersja.!\r\nNie zaleca się odinstalowania bieżącej wersji. Jeśli chcesz zainstalować tę wersję, należy najpierw odinstalować bieżącą."
LangString TextReinstEqual ${LANG_POLISH} "$(^Name) są instalowane."
Function PageReinstall
; Installationsverzeichnis lesen
ReadRegStr $R0 HKLM "${MOD_RKEY}" "InstallLocation"
StrCmp $R0 "" 0 +2
Abort
; Version überprüfen
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionFlags"
IntCmp $R0 ${VER_FLAGS} major wrong wrong
major:
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionMajor"
IntCmp $R0 ${VER_MAJOR} minor older newer
minor:
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionMinor"
IntCmp $R0 ${VER_MINOR} patch older newer
patch:
ReadRegDWORD $R0 HKLM "${MOD_RKEY}" "VersionPatch"
IntCmp $R0 ${VER_PATCH} equal older newer
wrong:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstWrong)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt1A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt1B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead1)"
StrCpy $R0 "1"
Goto start
older:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstOlder)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt1A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt1B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead1)"
StrCpy $R0 "1"
Goto start
newer:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstNewer)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt1A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt1B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead1)"
StrCpy $R0 "1"
Goto start
equal:
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 1" "Text" "$(TextReinstEqual)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 2" "Text" "$(TextReinstOpt2A)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setup.ini" "Field 3" "Text" "$(TextReinstOpt2B)"
!insertmacro MUI_HEADER_TEXT "$(TextReinstTitle)" "$(TextReinstHead2)"
StrCpy $R0 "2"
start:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "setup.ini"
FunctionEnd
Function PageLeaveReinstall
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "setup.ini" "Field 2" "State"
StrCmp $R0 "1" 0 +2
StrCmp $R1 "1" inst done
StrCmp $R0 "2" 0 +3
StrCmp $R1 "1" done inst
inst:
HideWindow
ReadRegStr $R1 HKLM "${MOD_RKEY}" "UninstallString"
ClearErrors
ExecWait '$R1 _?=$INSTDIR'
IfErrors nope
IfFileExists $R1 "" nope
Delete $R1
nope:
StrCmp $R0 "2" 0 +2
Quit
BringToFront
done:
FunctionEnd
; Installer (Verzeichnisprüfung)
Var VerifyMessageOnce
Function .onVerifyInstDir
; Version 2.6 deutsch installiert ?
!insertmacro g2mod_IfInstallVersion $INSTDIR "2.6.0.0" done
; Basisversion 2.6 ?
!insertmacro g2mod_IfInstallVersionBase $INSTDIR "2.6" code
Goto nope
code:
; Deutsche Version ?
!insertmacro g2mod_IfInstallVersionCode $INSTDIR 0 done
; Keine 2.6-er (deutsch)...
nope:
; Meldung nur einmalig anzeigen
StrCmp $VerifyMessageOnce "done" +3
MessageBox MB_OK|MB_ICONINFORMATION "Proszę wybrać ścieżkę, w której zainstalowany jest 'Gothic II - Noc Kruka' 2.6."
StrCpy $VerifyMessageOnce "done"
Abort
done:
FunctionEnd
I want to add this somewhere in MUI_PAGE_WELCOME2. I've found how to make such hyperlink, but I don't know how to implement it into mine installer:
!include "nsDialogs.nsh"
!include "winmessages.nsh"
!include "logiclib.nsh"
OutFile "test.exe"
Page Custom pre
var dialog
var hwnd
Function pre
nsDialogs::Create 1018
Pop $dialog
${NSD_CreateLink} 0 0 40% 6% "Group 1, Radio 1"
Pop $hwnd
${NSD_AddStyle} $hwnd ${WS_GROUP}
${NSD_OnClick} $hwnd Group1Radio1Click
${NSD_CreateLink} 0 12% 40% 6% "Group 1, Radio 2"
Pop $hwnd
${NSD_OnClick} $hwnd Group1Radio2Click
nsDialogs::Show
FunctionEnd
Function Group1Radio1Click
Pop $hwnd
ExecShell "open" "http://zlotewrota.org"
FunctionEnd
Function Group1Radio2Click
Pop $hwnd
MessageBox MB_OK "onClick:Group1Radio2"
FunctionEnd
Section ""
SectionEnd