![]() |
#1 |
Junior Member
Join Date: Feb 2021
Posts: 3
|
Hello.could you help me?
I recently learned this software and successfully implemented my installer with background music.Here is my code:
; ######################################## ; # Graphical Installer for NSIS # ; # Version 4.10.01 (Webka) # ; # Copyright (c) 2006 - 2021 # ; # unSigned, s. r. o. # ; # http://www.graphical-installer.com # ; # http://www.unsigned.sk # ; ######################################## ; Script generated with Graphical Installer Wizard for NSIS (v1.15.01) ; Unique identifier of project: ; GRAPHICAL_INSTALLER_PROJECT_UID (was defined): {My application-1.0-My company, Inc.-http://www.mycompany.com #15696175104 |65998417920 @ 2021/2/11 14:32:16} ; Included file for Modern UI 2 !include "MUI2.nsh" ; Included file with graphic settings !include "mythird.graphics.nsh" ; Included file with Graphical Installer functions !include "${NSISDIR}\Graphical Installer\GraphicalInstaller_functions.nsh" ; Graphical Installer Wizard common defines !define PRODUCT_NAME "Heroes III map Atlantic Revolution setup" !define PRODUCT_VERSION "1.0" !define PRODUCT_PUBLISHER "@Zevet Zheng" !define PRODUCT_WEB_SITE "http://www.Maps4hero.com" Name "${PRODUCT_NAME}" OutFile "Heroes III map Atlantic Revolution setup.exe" InstallDir "Select your Heroes 3 game root directory" Caption "${PRODUCT_NAME}" ShowInstDetails show BrandingText "Heroes III epic map series" RequestExecutionLevel user ; =================== ; Installer pages ; =================== ; Comment out this line if You do not want to show confirm dialog when Cancel button is pressed !define MUI_ABORTWARNING !define MUI_WELCOMEPAGE_TITLE_3LINES ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !define MUI_PAGE_CUSTOMFUNCTION_SHOW GraphicalInstallerRedraw !insertmacro MUI_PAGE_LICENSE "..\..\..\Program Files (x86)\NSISeng\Graphical Installer\readme.txt" ; UI for Installer and Uninstaller ${GraphicalInstallerChangeUI} XPStyle on ; Components page !define MUI_PAGE_CUSTOMFUNCTION_SHOW GraphicalInstallerRedraw !insertmacro MUI_PAGE_COMPONENTS ; Directory page !define MUI_PAGE_CUSTOMFUNCTION_SHOW GraphicalInstallerRedraw !insertmacro MUI_PAGE_DIRECTORY ; InstFiles page !define MUI_PAGE_CUSTOMFUNCTION_SHOW GraphicalInstallerRedraw !insertmacro MUI_PAGE_INSTFILES ; Finish page !define FINISHPAGE_NOAUTOCLOSE !insertmacro MUI_PAGE_FINISH ; ====================== ; Language settings ; ====================== !insertmacro MUI_LANGUAGE "English" ; Reserve files ReserveFile "${NSISDIR}\Plugins\x86-unicode\splash.dll" ReserveFile "${NSISDIR}\Plugins\8.bmp" ReserveFile "${NSISDIR}\Plugins\x86-ansi\system.dll" ReserveFile "${NSISDIR}\Plugins\ElemTown.wav" ReserveFile "${NSISDIR}\Plugins\x86-unicode\splash.dll" ReserveFile "${NSISDIR}\Plugins\x86-ansi\system.dll" ReserveFile "${NSISDIR}\Plugins\VIVE.mp3" !insertmacro MUI_RESERVEFILE_LANGDLL ; Installer properties VIProductVersion "4.10.0.1" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Graphical Installer. Copyright (c) 2006 - 2021 unSigned, s. r. o. http://graphical-installer.com/" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PRODUCT_PUBLISHER}" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Made by ${PRODUCT_PUBLISHER}" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${PRODUCT_VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} "InternalName" "Heroes III map《Atlantic Revolution》" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Copyright (c) 2021 ${PRODUCT_PUBLISHER}" VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "《Atlantic Revolution》" ; Language strings - captions of sections LangString DESC_Section00 ${LANG_ENGLISH} " " ; No description LangString DESC_Section01 ${LANG_ENGLISH} "" ; ================= ; Install Data ; ================= ; Invisible section - required for proper initialization, do not delete this section! Section "" Section00 SectionIn RO ; Initialization of Install page ${GraphicalInstallerInitInstallPage} SectionEnd Section "Map files" Section01 SetOutPath "$INSTDIR\data" SetOverwrite try File "..\Desktop\a\data\HPL000el.pcx" File "..\Desktop\a\data\HPL000Kn.pcx" File "..\Desktop\a\data\HPL000pl.pcx" File "..\Desktop\a\data\HPL000Sh.pcx" File "..\Desktop\a\data\HPL001el.pcx" File "..\Desktop\a\data\HPL001Kn.pcx" File "..\Desktop\a\data\HPL001pl.pcx" File "..\Desktop\a\data\HPL001Sh.pcx" File "..\Desktop\a\data\HPL002el.pcx" SetOutPath "$INSTDIR\maps" File "..\Desktop\a\maps\Atlantic Revolution.h3m" SetOutPath "$INSTDIR\mp3" File "..\Desktop\a\mp3\ElemTown.mp3" File "..\Desktop\a\mp3\CstleTown.mp3" SetOutPath "$INSTDIR" File "..\Desktop\a\aa.txt" SectionEnd Section -Post SectionEnd Function .onGUIEnd ; Unloading of GraphicalInstaller plugin GraphicalInstaller::UnInitButtons FunctionEnd Function .onInit InitPluginsDir File "/oname=$PLUGINSDIR\Splash_8.bmp" "${NSISDIR}\Plugins\8.bmp" File "/oname=$PLUGINSDIR\Splash_8.wav" "${NSISDIR}\Plugins\ElemTown.wav" advsplash::show 9500 3850 850 -1 "$PLUGINSDIR\Splash_8" Pop $0 File "/oname=$PLUGINSDIR\bgm_VIVE.mp3" "${NSISDIR}\Plugins\VIVE.mp3" System::Call "winmm.dll::mciSendString(t 'OPEN $PLUGINSDIR\bgm_VIVE.mp3 TYPE MPEGVIDEO ALIAS BGMUSIC', t .r0, i 130, i 0)" System::Call "winmm.dll::mciSendString(t 'PLAY BGMUSIC NOTIFY REPEAT', t .r0, i 130, i 0)" FunctionEnd Function un.onGUIEnd ; Unloading of GraphicalInstaller plugin GraphicalInstaller::UnInitButtons System::Call "winmm.dll::mciSendString(t 'STOP BGMUSIC',t .r0,i 130,i 0)" System::Call "winmm.dll::mciSendString(t 'CLOSE BGMUSIC',t .r0,i 130,i 0)" FunctionEnd ----------------------------------------------------------------------------------------------------- and the "mythird.graphics.nsh": ; ######################################## ; # Graphical Installer for NSIS # ; # Version 4.10.01 (Webka) # ; # Copyright (c) 2006 - 2021 # ; # unSigned, s. r. o. # ; # http://www.graphical-installer.com # ; # http://www.unsigned.sk # ; ######################################## ; # Graphics file # ; ######################################## ; ***************************************************************************** ; * This file contains settings for graphical interface. Modify them freerly. * ; * Read enclosed documentation (and comments in scripts) for more details. * ; ***************************************************************************** ; Script generated with Graphical Installer Wizard for NSIS (v1.15.01) !echo "Graphical Installer for NSIS v4.10.01 (Webka). Copyright (c) 2006 - 2021 unSigned, s. r. o. Graphics file." ; Unique identifier of project: (Comment out this symbol to switch the design of installer) !define GRAPHICAL_INSTALLER_PROJECT_UID "{My application-1.0-My company, Inc.-http://www.mycompany.com #15696175104 |65998417920 @ 2021/2/11 14:32:16}" ; Compression SetCompressor bzip2 ; Installer icon !define MUI_ICON "${NSISDIR}\888.ico" ; Uninstaller icon !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" ; License page selection ; Installer background picture !define GRAPHICAL_INSTALLER_BACKGROUND_BITMAP "..\..\..\Program Files (x86)\NSISeng\Graphical Installer\Skins\brown-skin.jpg" ; 690x496 px !define GRAPHICAL_INSTALLER_SMALL_BITMAP "..\..\..\Program Files (x86)\NSISeng\Graphical Installer\Skins\brown-skin-inner.jpg" ; 450x228 px ; Color of labels in installer - all visible texts. Format: 0xRRGGBB !define GRAPHICAL_INSTALLER_LABELS_TEXT_COLOR "0xFFFFFF" ; Color of headers (usually at the top of page) !define GRAPHICAL_INSTALLER_HEADER_TEXT_COLOR "0xFFFFFF" ; See documentation for details about creating button picture !define GRAPHICAL_INSTALLER_BUTTON_BITMAP "..\..\..\Program Files (x86)\NSISeng\Graphical Installer\Buttons\button-1.bmp" ; 83x104 px - 4 states: normal, focused, pressed, disabled ; Color for button texts for Normal/Focused/Pressed/Disabled state. Format: 0xRRGGBB !define GRAPHICAL_INSTALLER_BUTTONS_TEXT_COLOR "0xFF0000" !define GRAPHICAL_INSTALLER_BUTTONS_TEXT_COLOR_FOCUSED "0x000000" !define GRAPHICAL_INSTALLER_BUTTONS_TEXT_COLOR_PRESSED "0x000000" !define GRAPHICAL_INSTALLER_BUTTONS_TEXT_COLOR_DISABLED "0x000000" ; End of file (EOF) The question is,how do I add multi-language installation options, where do I add them, and what is the codes? |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
NSIS\Examples\Modern UI\MultiLanguage.nsi
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Feb 2021
Posts: 3
|
Can you directly tell me which sentences should be added? I can't understand the example,thanks.
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
That is a very simple example, if you cannot understand it then you need to go back to Example1.nsi and read NSIS.chm before asking another question.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Feb 2021
Posts: 3
|
I really can't do it,could anyone add lines of French for example in my work plz.Then I can do the rest languages myself .Thanks!
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|