literature

CG Installer Script +Ind

Deviation Actions

stardust-oracle's avatar
Published:
632 Views

Literature Text

; CameliaGirls installer script is originally made by ~nekoCAT21
; I only translate the phrases that ~nekoCAT21 pinpoints

In the interest of being open I submit the first version of the NSIS installer script of Camelia for review:

; This NSIS script is for the game CameliaGirls.
; The use of this file is simple.
; 1) extract the win32 zip file of a release
; 2) add or create icon files icon-high.ico and icon-low.ico
; 3) modify the script for the release acordingly, some files may be added or removed between releases

; 4) save the script as a text document with a .nsi or .nsh filetype
; 5) copy the script into the directory of the game exe

; 6) compile installer with NSIS
; The NSIS compiler will alert you to any issues and will stop after identifying the line.
; NSIS is freely available at nsis.sourceforge.net/.
; This file is free to use and modify.
; Todo: All instances of TRANSLATE need to be replaced with appropriate translations.
; Script Version 0.1b Created by nekoCAT21

;The defines will need to be updated accordingly with each release.
!define PRODUCT_NAME "CameliaGirls"
!define PRODUCT_VERSION "0.560a"
!define PRODUCT_PUBLISHER "Pigux Productions and Studio TT Petok"
!define PRODUCT_WEB_SITE "cameliagirls.com"
!define PRODUCT_DIR_REGKEY "SoftwareMicrosoftWindowsCurrentVersionApp PathsCameliaGirls.exe"
!define PRODUCT_UNINST_KEY "SoftwareMicrosoftWindowsCurrentVersionUninstall${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}ContribGraphicsIconsmodern-install.ico" ;Installer's icon, better ones are appreciated.
!define MUI_UNICON "${NSISDIR}ContribGraphicsIconsmodern-uninstall.ico" ;Uninstaller's icon, better ones are appreciated.

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

;The macros are the pages in the installer and the define allows the game to be started after install.
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIRCameliaGirls.exe"
!insertmacro MUI_PAGE_FINISH

; These macros are the uninstaller pages.
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES

; These are the languages currently supported by the installer.
; To add more languages simply add the appropiate MUI_LANGUAGE macro and add LangString translations for the hardcoded strings.
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Spanish"


; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "CameliaGirls-installer.exe"
InstallDir "$PROGRAMFILESCameliaGirls"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails hide
ShowUnInstDetails hide

Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

;Language strings for the components (the game and desktop icons) in the installer.
LangString Install1 ${LANG_ENGLISH} "Install CameliaGirls"
LangString Install1 ${LANG_INDONESIAN} "Menginstall cewek Cewek Camelia"
LangString Install1 ${LANG_SPANISH} "TRANSLATE"

LangString Install2 ${LANG_ENGLISH} "Create Desktop Icon"
LangString Install2 ${LANG_INDONESIAN} "Memunculkan Ikon Desktop"
LangString Install2 ${LANG_SPANISH} "TRANSLATE"

Section $(Install1) SEC01
  SetOutPath "$INSTDIR"
  SetOverwrite try
  File "icon-low.png"
  File "icon.hqx"
  File "python25.dll"
  File "README.html"
  File "CameliaGirls.py"
  File "CameliaGirls.exe"
  File "icon-low.ico"
  File "icon-high.ico"
  CreateDirectory "$SMPROGRAMSCameliaGirls"  ;Create a CameliaGirls folder in menu.
;Adds a game launcher to the folder in the menu.
  CreateShortCut "$SMPROGRAMSCameliaGirls@CameliaGirls.lnk" "$INSTDIRCameliaGirls.exe" Icon "$INSTDIRicon-high.ico"
  File "version0.56a" ;This file will need to change with every release.
  File "msvcr71.dll"
  File "renpy.code"
  File "icon-high.png"
  File "license.txt"
  File /r ".renpy"
  File /r ".common"
  File /r ".game"
SectionEnd

;This is the code to create an icon for the desktop.
Section $(Install2) SEC02
  CreateShortCut "$DESKTOP@CameliaGirls.lnk" "$INSTDIRCameliaGirls.exe" Icon "$INSTDIRicon-high.ico"
SectionEnd

;This creates an uninstaller icon in the CameliaGirls folder in the menu.
Section -AdditionalIcons
  CreateShortCut "$SMPROGRAMSCameliaGirlsUninstall.lnk" "$INSTDIRuninst.exe"
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIRuninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIRCameliaGirls.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIRuninst.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIRCameliaGirls.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd

; Installer descriptions.
LangString DESC_Game1 ${LANG_ENGLISH} "This will install CameliaGirls to the hard drive.  This is required to play."
LangString DESC_Game1 ${LANG_INDONESIAN} "Opsi ini akan menginstall cewek Cewek Camelia ke hard drive. Diperlukan untuk dapat memainkan game."
LangString DESC_Game1 ${LANG_SPANISH} "TRANSLATE"

LangString DESC_Icon1 ${LANG_ENGLISH} "This will create an icon to launch the game from the desktop."
LangString DESC_Icon1 ${LANG_INDONESIAN} "Opsi ini akan memunculkan ikon di desktop untuk secara otomatis bermain game."
LangString DESC_Icon1 ${LANG_SPANISH} "TRANSLATE"

;These are the defines for the description texts in the installer.  The text is in the language strings above.
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_Game1)
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_Icon1)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;The following components are the uninstaller and its translations.
LangString Confirm1 ${LANG_ENGLISH} "CameliaGirls was successfully removed from your computer."
LangString Confirm1 ${LANG_INDONESIAN} "cewek Cewek Camelia berhasil dihapus dari komputer anda."
LangString Confirm1 ${LANG_SPANISH} "TRANSLATE"

Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK $(Confirm1)
FunctionEnd

LangString Confirm2 ${LANG_ENGLISH} "Are you sure you want to completely remove CameliaGirls and all of its components?"
LangString Confirm2 ${LANG_INDONESIAN} "Apakah anda yakin bahwa anda ingin menghapus keseluruhan cewek Cewek Camelia beserta komponen-komponennya?"
LangString Confirm2 ${LANG_SPANISH} "TRANSLATE"


Function un.onInit ;This dialouge needs to be fixed.  It ignores the language settings and uses English.
!insertmacro MUI_UNGETLANGUAGE
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(Confirm2) IDYES +2
  Abort
FunctionEnd

LangString Uninstall1 ${LANG_ENGLISH} "Remove CameliaGirls"
LangString Uninstall1 ${LANG_INDONESIAN} "Menghapus cewek Cewek Camelia"
LangString Uninstall1 ${LANG_SPANISH} "TRANSLATE"

LangString Uninstall2 ${LANG_ENGLISH} "Delete preferences and save files"
LangString Uninstall2 ${LANG_INDONESIAN} "Menghapus preferensi dan save file"
LangString Uninstall2 ${LANG_SPANISH} "TRANSLATE"

Section un.$(Uninstall1) un.SecUnProgramFiles
  Delete "$INSTDIRuninst.exe"
  Delete "$INSTDIRlicense.txt"  
  Delete "$INSTDIRicon-high.png"  
  Delete "$INSTDIRrenpy.code"
  Delete "$INSTDIRmsvcr71.dll"
  Delete "$INSTDIRversion0.56a" ;This file will need to change with every release.
  Delete "$INSTDIRCameliaGirls.exe"
  Delete "$INSTDIRCameliaGirls.py"  
  Delete "$INSTDIRREADME.html"
  Delete "$INSTDIRpython25.dll"
  Delete "$INSTDIRicon.hqx"
  Delete "$INSTDIRicon-low.png"
  Delete "$INSTDIRicon-low.ico"
  Delete "$INSTDIRicon-high.ico"

  Delete "$SMPROGRAMSCameliaGirlsUninstall.lnk"
  Delete "$DESKTOP@CameliaGirls.lnk"
  Delete "$SMPROGRAMSCameliaGirls@CameliaGirls.lnk"

  RMDir "$SMPROGRAMSCameliaGirls"
  RMDir /r "$INSTDIRrenpy"
  RMDir /r "$INSTDIRgame"
  RMDir /r "$INSTDIRcommon"
  RMDir "$INSTDIR"


  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  SetAutoClose true
SectionEnd


Section un.$(Uninstall2) un.SecUnPreferences
  Delete "$APPDATARenPycameliagirls*.save"
  Delete "$APPDATARenPycameliagirlspersistent"
SectionEnd


;Uninstaller descriptions.
LangString DESC_Program1 ${LANG_ENGLISH} "This will remove CameliaGirls from your computer."
LangString DESC_Program1 ${LANG_INDONESIAN} "Opsi ini akan menghapus cewek Cewek Camelia dari komputer anda."
LangString DESC_Program1 ${LANG_SPANISH} "TRANSLATE"

LangString DESC_Preference1 ${LANG_ENGLISH} "This will remove any game saves and preferences for CameliaGirls."
LangString DESC_Preference1 ${LANG_INDONESIAN} "Opsi ini akan menghapus semua save file dan preferensi anda di cewek Cewek Camelia"
LangString DESC_Preference1 ${LANG_SPANISH} "TRANSLATE"


;These are the defines for the description texts in the uninstaller.  The text is in the language strings above.
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} $(DESC_Program1)
  !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} $(DESC_Preference1)
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END</code
The original installer script is made by :iconnekocat21:
(btw I'm not sure how to hide "by stardust-oracle" under the title, because basically it's not mine)

My job as an Indonesian translator requires me to replace the tag "TRANSLATE" with the appropriate translation. I sought some advice from :iconc-quel: and :iconhayashinomura: before I submit this, so hopefully everything is okay :)

Any suggestion is welcomed, especially if I missed something ^^;
Comments14
Join the community to add your comment. Already a deviant? Log In
ArkBlitz's avatar
Doubt: do you translate "Camelia Girls" to Spanish as "Chicas Camelia", or as is?