Vytvoření instalátoru s češtinou pro WoW: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
(Založena nová stránka: =Instalace pomocných nástrojů= =Příprava souborů= =Nastavení skriptu instalátoru= Kategorie:WoW) |
Bez shrnutí editace |
||
Řádek 2: | Řádek 2: | ||
=Příprava souborů= |
=Příprava souborů= |
||
Vytvořte si nějakou složku např. ''CzechWoW 3.3.3a'', ve které si připravíte soubory pro instalátor. |
|||
* Stáhněte z webu [http://wowpreklad.zdechov.net/download.php wowprekladu] soubor WoWLua pro požadovanou verzi klienta, kterou máte na serveru. Např. WowLua_3.3.3a.exe a přejmenujte jej na WowLua.exe. |
|||
=Nastavení skriptu instalátoru= |
=Nastavení skriptu instalátoru= |
||
<pre>;NSIS Modern User Interface version 1.70 |
|||
;-------------------------------- |
|||
;Include Modern UI |
|||
!include "MUI.nsh" |
|||
;-------------------------------- |
|||
;General |
|||
!define VERSION "3.3.3a" |
|||
!define RELEASE_DATE "2010-04-23" |
|||
!define TITLE "CzechWoW" |
|||
!define FULL_TITLE "Český překlad WoW" |
|||
!define CREATOR "Chronos" |
|||
!define CHANGELOG_FILE "CzechWoW.htm" |
|||
!define LOCALE "czCZ" |
|||
;Name and file |
|||
Name "${FULL_TITLE} ${VERSION}" |
|||
OutFile "Instalace_${TITLE}_${VERSION}_${RELEASE_DATE}.exe" |
|||
;Default installation folder |
|||
InstallDir "$PROGRAMFILES\World of Warcraft\" |
|||
;Get installation folder from registry if available |
|||
InstallDirRegKey HKLM "Software\Blizzard Entertainment\World of Warcraft" "InstallPath" |
|||
;-------------------------------- |
|||
;Interface Settings |
|||
!define MUI_ABORTWARNING |
|||
;-------------------------------- |
|||
;Language Selection Dialog Settings |
|||
;Remember the installer language |
|||
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU" |
|||
!define MUI_LANGDLL_REGISTRY_KEY "Software\${CREATOR}\${FULL_TITLE}" |
|||
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" |
|||
;-------------------------------- |
|||
;Pages |
|||
!define MUI_ICON "WoW.ico" |
|||
!define MUI_UNICON "WoW.ico" |
|||
;!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" |
|||
!insertmacro MUI_PAGE_WELCOME |
|||
;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Contrib\Modern UI\License.txt" |
|||
!insertmacro MUI_PAGE_COMPONENTS |
|||
!insertmacro MUI_PAGE_DIRECTORY |
|||
!insertmacro MUI_PAGE_INSTFILES |
|||
!insertmacro MUI_UNPAGE_CONFIRM |
|||
!insertmacro MUI_UNPAGE_INSTFILES |
|||
;-------------------------------- |
|||
;Languages |
|||
!insertmacro MUI_LANGUAGE "Czech" |
|||
;-------------------------------- |
|||
;Reserve Files |
|||
;These files should be inserted before other files in the data block |
|||
;Keep these lines before any File command |
|||
;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) |
|||
!insertmacro MUI_RESERVEFILE_LANGDLL |
|||
;-------------------------------- |
|||
;Installer Sections |
|||
Section "Základní soubory" Base |
|||
SetDetailsPrint textonly |
|||
DetailPrint "Instaluji základní soubory..." |
|||
SetDetailsPrint listonly |
|||
SectionIn RO ; Read only section |
|||
; Write the uninstall keys for Windows |
|||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "DisplayName" "${FULL_TITLE}" |
|||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "UninstallString" '"$INSTDIR\Uninstall.exe"' |
|||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "NoModify" 1 |
|||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "NoRepair" 1 |
|||
SetOutPath "$INSTDIR" |
|||
;ADD YOUR OWN FILES HERE... |
|||
File "WowLua.exe" |
|||
File "${CHANGELOG_FILE}" |
|||
SetOutPath "$INSTDIR\Data" |
|||
File "patch-5.MPQ" |
|||
IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 |
|||
Rename "$INSTDIR\Data\patch-5.MPQ" "$INSTDIR\Data\enGB\patch-enGB-5.MPQ" |
|||
Goto +2 |
|||
Rename "$INSTDIR\Data\patch-5.MPQ" "$INSTDIR\Data\enUS\patch-enUS-5.MPQ" |
|||
;Store installation folder |
|||
WriteRegStr HKCU "Software\${CREATOR}\${TITLE}" "" $INSTDIR |
|||
;Create uninstaller |
|||
WriteUninstaller "$INSTDIR\Uninstall.exe" |
|||
SectionEnd |
|||
Section "Zástupci nabídky Start" StartMenuShortCut |
|||
SetDetailsPrint textonly |
|||
DetailPrint "Instaluji Zástupce nabídky Start..." |
|||
SetDetailsPrint listonly |
|||
CreateDirectory "$SMPROGRAMS\${FULL_TITLE}" |
|||
SetOutPath "$INSTDIR" |
|||
CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" |
|||
CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\České WoW.lnk" "$INSTDIR\WowLua.exe" |
|||
CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápověda.lnk" "$INSTDIR\${CHANGELOG_FILE}" |
|||
SectionEnd |
|||
Section "Zástupci na plochu" DesktopShortCut |
|||
SetDetailsPrint textonly |
|||
DetailPrint "Instaluji zástupce na plochu..." |
|||
SetDetailsPrint listonly |
|||
CreateShortCut "$DESKTOP\České WoW.lnk" "$INSTDIR\WowLua.exe" |
|||
SectionEnd |
|||
Section "Zobrazit informace" ShowChangeLog |
|||
SetDetailsPrint textonly |
|||
DetailPrint "Zobrazuji doplňující informace..." |
|||
SetDetailsPrint listonly |
|||
ExecShell "open" "$INSTDIR\${CHANGELOG_FILE}" |
|||
SectionEnd |
|||
Section "Smazat WDB cache" DeleteWDBCache |
|||
SetDetailsPrint textonly |
|||
DetailPrint "Mažu WDB cache..." |
|||
SetDetailsPrint listonly |
|||
RMDir /r "$INSTDIR\Cache\WDB" |
|||
SectionEnd |
|||
;-------------------------------- |
|||
;Installer Functions |
|||
Function .onInit |
|||
!insertmacro MUI_LANGDLL_DISPLAY |
|||
FunctionEnd |
|||
;-------------------------------- |
|||
;Descriptions |
|||
;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC |
|||
;Assign descriptions to sections |
|||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
|||
!insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" |
|||
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "Přidá zástupce do Nabídky start pro snadné použití" |
|||
!insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "Přidá zástupce na plochu" |
|||
!insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" |
|||
!insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." |
|||
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
|||
;-------------------------------- |
|||
;Uninstaller Section |
|||
Section "Uninstall" |
|||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" |
|||
Delete "$DESKTOP\${TITLE}.lnk" |
|||
RMDir /r "$SMPROGRAMS\${FULL_TITLE}" |
|||
Delete "$INSTDIR\WowLua.exe" |
|||
IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 |
|||
Delete "$INSTDIR\Data\enGB\patch-enGB-5.MPQ" |
|||
Goto +2 |
|||
Delete "$INSTDIR\Data\enUS\patch-enUS-5.MPQ" |
|||
Delete "$INSTDIR\Data\patch-5.MPQ" |
|||
Delete "$INSTDIR\${CHANGELOG_FILE}" |
|||
Delete "$INSTDIR\Uninstall.exe" |
|||
DeleteRegKey /ifempty HKCU "Software\${CREATOR}\${FULL_TITLE}" |
|||
SectionEnd |
|||
;-------------------------------- |
|||
;Uninstaller Functions |
|||
Function un.onInit |
|||
!insertmacro MUI_UNGETLANGUAGE |
|||
FunctionEnd |
|||
</pre> |
|||
=Vnější odkazy= |
|||
* [http://wowpreklad.zdechov.net/ Projekt wowpreklad] |
|||
Verze z 12. 6. 2010, 10:13
Instalace pomocných nástrojů
Příprava souborů
Vytvořte si nějakou složku např. CzechWoW 3.3.3a, ve které si připravíte soubory pro instalátor.
- Stáhněte z webu wowprekladu soubor WoWLua pro požadovanou verzi klienta, kterou máte na serveru. Např. WowLua_3.3.3a.exe a přejmenujte jej na WowLua.exe.
Nastavení skriptu instalátoru
;NSIS Modern User Interface version 1.70 ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;-------------------------------- ;General !define VERSION "3.3.3a" !define RELEASE_DATE "2010-04-23" !define TITLE "CzechWoW" !define FULL_TITLE "Český překlad WoW" !define CREATOR "Chronos" !define CHANGELOG_FILE "CzechWoW.htm" !define LOCALE "czCZ" ;Name and file Name "${FULL_TITLE} ${VERSION}" OutFile "Instalace_${TITLE}_${VERSION}_${RELEASE_DATE}.exe" ;Default installation folder InstallDir "$PROGRAMFILES\World of Warcraft\" ;Get installation folder from registry if available InstallDirRegKey HKLM "Software\Blizzard Entertainment\World of Warcraft" "InstallPath" ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING ;-------------------------------- ;Language Selection Dialog Settings ;Remember the installer language !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" !define MUI_LANGDLL_REGISTRY_KEY "Software\${CREATOR}\${FULL_TITLE}" !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" ;-------------------------------- ;Pages !define MUI_ICON "WoW.ico" !define MUI_UNICON "WoW.ico" ;!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" !insertmacro MUI_PAGE_WELCOME ;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Contrib\Modern UI\License.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "Czech" ;-------------------------------- ;Reserve Files ;These files should be inserted before other files in the data block ;Keep these lines before any File command ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) !insertmacro MUI_RESERVEFILE_LANGDLL ;-------------------------------- ;Installer Sections Section "Základní soubory" Base SetDetailsPrint textonly DetailPrint "Instaluji základní soubory..." SetDetailsPrint listonly SectionIn RO ; Read only section ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "DisplayName" "${FULL_TITLE}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "UninstallString" '"$INSTDIR\Uninstall.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "NoRepair" 1 SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... File "WowLua.exe" File "${CHANGELOG_FILE}" SetOutPath "$INSTDIR\Data" File "patch-5.MPQ" IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 Rename "$INSTDIR\Data\patch-5.MPQ" "$INSTDIR\Data\enGB\patch-enGB-5.MPQ" Goto +2 Rename "$INSTDIR\Data\patch-5.MPQ" "$INSTDIR\Data\enUS\patch-enUS-5.MPQ" ;Store installation folder WriteRegStr HKCU "Software\${CREATOR}\${TITLE}" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd Section "Zástupci nabídky Start" StartMenuShortCut SetDetailsPrint textonly DetailPrint "Instaluji Zástupce nabídky Start..." SetDetailsPrint listonly CreateDirectory "$SMPROGRAMS\${FULL_TITLE}" SetOutPath "$INSTDIR" CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\České WoW.lnk" "$INSTDIR\WowLua.exe" CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápověda.lnk" "$INSTDIR\${CHANGELOG_FILE}" SectionEnd Section "Zástupci na plochu" DesktopShortCut SetDetailsPrint textonly DetailPrint "Instaluji zástupce na plochu..." SetDetailsPrint listonly CreateShortCut "$DESKTOP\České WoW.lnk" "$INSTDIR\WowLua.exe" SectionEnd Section "Zobrazit informace" ShowChangeLog SetDetailsPrint textonly DetailPrint "Zobrazuji doplňující informace..." SetDetailsPrint listonly ExecShell "open" "$INSTDIR\${CHANGELOG_FILE}" SectionEnd Section "Smazat WDB cache" DeleteWDBCache SetDetailsPrint textonly DetailPrint "Mažu WDB cache..." SetDetailsPrint listonly RMDir /r "$INSTDIR\Cache\WDB" SectionEnd ;-------------------------------- ;Installer Functions Function .onInit !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd ;-------------------------------- ;Descriptions ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC ;Assign descriptions to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "Přidá zástupce do Nabídky start pro snadné použití" !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "Přidá zástupce na plochu" !insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" Delete "$DESKTOP\${TITLE}.lnk" RMDir /r "$SMPROGRAMS\${FULL_TITLE}" Delete "$INSTDIR\WowLua.exe" IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 Delete "$INSTDIR\Data\enGB\patch-enGB-5.MPQ" Goto +2 Delete "$INSTDIR\Data\enUS\patch-enUS-5.MPQ" Delete "$INSTDIR\Data\patch-5.MPQ" Delete "$INSTDIR\${CHANGELOG_FILE}" Delete "$INSTDIR\Uninstall.exe" DeleteRegKey /ifempty HKCU "Software\${CREATOR}\${FULL_TITLE}" SectionEnd ;-------------------------------- ;Uninstaller Functions Function un.onInit !insertmacro MUI_UNGETLANGUAGE FunctionEnd