The installer / uninstaller of our Pillars of Hercules Theater Beta 0.5.0. Fully functional and tested
Install / Uninstall in one step.
It can be downloaded
here. I have included the directories and files that must be put in each folder and program and NSIS edit plugins required.
Are necessary skills in the use of HM NIS Edit to edit it and adapt it to your theater.
Now I'm working on automating the installation/unistall of custom screens "LOADING" and "STAND BY". I also have nearly completed a script to include images as wallpaper that appear as it progresses the installation process. Add these new features in the beta 0.6.0
INSTALLER POH AF/Of/RV
Code: Select all
;DEFINICIÓN DE PARÁMETROS
!define TNAME "POH"
!define APP_NAME "Pillars of Hercules Theater"
!define APP "POHInstalador"
;for some reason, this has to be #.#.#.# but I usually change the name after I build the exe
!define VER "0.5.0.0"
!define INSTDIR_REG_ROOT "HKLM"
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
; define other variables to free up generic ones
var ErrCode
var F4ver
var F4subver
var F4Root
; these establish some things about the installer the most important one to me is the outfile
Name "${APP_NAME}"
; outfile is the name of the installer. Unless otherwise set, it will be the same directory as where the script is
OutFile "${APP_NAME} Beta ${VER}.exe"
Caption "${APP_NAME}"
; these VI definitions are what is displayed if you hover the mouse over the icon
VIProductVersion "${VER}"
VIAddVersionKey ProductName "${APP_NAME}"
VIAddVersionKey Comments "Teatro de Operaciones ${TNAME} (${APP_NAME}) desarrollado por la comunidad."
VIAddVersionKey LegalCopyright "F4Spain/F4Portugal"
VIAddVersionKey FileDescription "${APP_NAME}"
VIAddVersionKey FileVersion "${VER}"
VIAddVersionKey ProductVersion "${VER}"
VIAddVersionKey InternalName "${APP_NAME}"
;=== Runtime Switches
; the CRC check is something I use on bigger installers to make sure everything checks out.
CRCCheck On
; this makes it more efficient
AutoCloseWindow True
; this is something I use to make sure it uses the LZMA compression, which I believe is the best
SetCompressor lzma
; branding text is just something that's displayed at the bottom of the installer
BrandingText "www.f4spain.com"
;=== Includes - this will include the necessary dlls and functions that I use in the installer
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "Registry.nsh"
!include "WinMessages.nsh"
!include "TextFunc.nsh"
!include "Sections.nsh"
; MUI Settings - the MUI is the Modern UI for NSIS, this section defines its parameters (there are alot more that I don't use)
!define MUI_ABORTWARNING
!define MUI_INSTALLCOLORS /windows
ShowInstDetails nevershow
InstallDir "$INSTDIR"
InstallDirRegKey ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir"
; Welcome page - this is the first page of the installer (I also have a snippet for a splashscreen, but we'll keep this simple)
;!define MUI_WELCOMEFINISHPAGE_BITMAP "@@:\FF4Installers\leftgraphic.bmp"
; using the variables means we don't have to remember to change all these when we use the template for another theater
!define MUI_WELCOMEFINISHPAGE_BITMAP "F:\F4SPAIN\BETAS\BETA 0.5.0\ARCHIVOS_COMPILACION\banner.bmp" ;IMAGEN 164X314 PX
!define MUI_WELCOMEPAGE_TITLE "${APP_NAME} ${VER} Asistente de configuración"
!define MUI_WELCOMEPAGE_TEXT "El configurador instalará ${APP_NAME} ${VER} en tu instalación de Falcon."
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "F:\F4SPAIN\BETAS\THEATERS\${TNAME}\EULA.txt"
!define MUI_LICENSEPAGE_RADIOBUTTONS
; Instfiles page
!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_INSTFILES
; Finish page - this is the last page people see
!define MUI_FINISHPAGE_TITLE "${APP_NAME} ${VER} Instalación completada."
!define MUI_FINISHPAGE_TEXT "Click en 'Terminar' para cerrar el asistente."
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "Spanish"
AddBrandingImage top 50
;SECCIÓN DE INSTALACIÓN
;SELECCIÓN DE LA INSTALACIÓN
; now we're ready for the actual installer!
Section "Pillars of Hercules Theater_v${VER}" SEC01
;TIENE QUE SER ALARGADA. p.e.: 700x100 px LA IMAGEN SE ADAPTA
SetBrandingImage /RESIZETOFIT "F:\F4SPAIN\BETAS\BETA 0.5.0\ARCHIVOS_COMPILACION\imagen bottom\bitmap.bmp"
; F4registry check - if no F4 registry, it kicks to the end - the $0 is a variable that holds the -1 (not found) or 0 (found)
; we can also start to determine which install we have
${registry::KeyExists} "HKLM\Software\MicroProse\Falcon\4.0" $0
${registry::KeyExists} "HKLM\Software\Lead Pursuit\Battlefield Operations\Falcon" $1
; IntCmp compares the integer in $0 with our number (0) and if it is =, it goes to label "F4Exists"
IntCmp $0 0 F4Exists
IntCmp $1 0 AFInstall
; this copies the string to $ErrCode - I'm using that as an error label
StrCpy $ErrCode "Registro encontrado no adecuado."
Goto Error
F4Exists:
; this determines if there's an AF reg entry, and if so, it only advances 1 line, if not, it goes to F4Install
IntCmp $1 0 0 F4Version
; at this point, we need to determine if the person wants to install over "original" F4 or RV
Messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "" "Selecciona donde quieres instalar el teatro" "OF/RV" "AF" "Cancelar"
; this places the response 1, 2, or 3, into $0
Pop $0
IntCmp $0 3 Finish
IntCmp $0 2 AFInstall
F4Version:
; now we know they want OF/RV so we need to differentiate - I'm only going to look for RV, if it isn't RV, I'm going to assume OF for now
; this will also validate the install a bit
; this reads the specified registry value into $0
ReadRegStr $INSTDIR HKLM "Software\MicroProse\Falcon\4.0" "basedir"
; if the file exists, go to next line (don't skip a line) if it doesn't, go to label "NoFileFound"
IfFileExists $INSTDIR\theater.lst 0 NoFileFound
IfFileExists $INSTDIR\terrdata\objects\KoreaObj.Dxl RVFound
IfFileExists $INSTDIR\terrdata\objects\KoreaObj.lod OFFound NoFileFound
NoFileFound:
StrCpy $ErrCode "No se ha encontrado la instalación de Falcon. Selecciona la versión que tengas instalada: AF/OF/RV"
Goto Error
RVFound:
StrCpy $F4ver "F4"
StrCpy $F4subver "RV"
Goto RVInstall
OFFound:
StrCpy $F4ver "F4"
StrCpy $F4subver "OF"
Goto F4Install
;AF INSTALL
AFInstall:
ReadRegStr $INSTDIR HKLM "Software\Lead Pursuit\Battlefield Operations\Falcon" "basedir"
WriteRegStr HKLM SOFTWARE\${TNAME}-AF "Install_Dir" "$INSTDIR\Theaters\${TNAME}"
ReadRegStr $INSTDIR HKLM "SOFTWARE\${TNAME}-AF" "Install_Dir"
ReadRegStr $F4Root HKLM "Software\Lead Pursuit\Battlefield Operations\Falcon" "basedir"
StrCpy $1 "$F4Root\campaign\korea" ; campaing\save string
StrCpy $2 "$INSTDIR\utilidades\LxNormalFix.exe $$LP @${TNAME} @$INSTDIR\terrdata" ; lxnormalfix string
StrCpy $F4Ver "AF"
; Escribimos los registros de instalación dentro del directorio del registro
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "InstallDir" "$INSTDIR"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "DisplayName" "${APP_NAME}-AF"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "UninstallString" "$INSTDIR/Uninstall-${TNAME}-AF.exe"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "DisplayIcon" "$INSTDIR\${TNAME}.ico"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "Publisher" "F4Spain/F4Portugal"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "HelpLink" "www.f4spain.com"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF" "Comments" "Teatro para Falcon AF/OF/RV de la Península Ibérica, Islas Baleares, Canarias, Azores y Norte de África"
;Para crear un enlace directo en el escritorio al Manual del usuario.
MessageBox MB_YESNO "¿Desearás un enlace en el escritorio al Manual del usuario?" IDYES Enlace1 IDNO Prefinish1
Enlace1:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
CreateShortCut "$DESKTOP\Manual del usuario ${APP_NAME}-AF.lnk" "$INSTDIR\Manuales\Manualdelusuario.pdf"
Prefinish1:
MessageBox MB_YESNO "¿Desearás un enlace en el escritorio al Desinstalador?" IDYES Enlace2 IDNO CreateDirs
Enlace2:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
CreateShortCut "$DESKTOP\Desinstalador ${APP_NAME}-AF.lnk" "$INSTDIR\Uninstall-${TNAME}-AF.exe"
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "Instalación en un paso.Tarda bastante. Cierra todos los programas y deshabilita el protector de pantalla" "Instalar ${TNAME}" "Cancelar"
Pop $0
IntCmp $0 2 cancelAF
Goto CreateDirs
CancelAF:
Delete "$DESKTOP\Manual del usuario ${APP_NAME}-AF.lnk"
Delete "$DESKTOP\Desinstalador ${APP_NAME}-AF.lnk"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-AF"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "SOFTWARE\${TNAME}-AF"
Goto Cancel
;RV INSTALL
RVInstall:
WriteRegStr HKLM SOFTWARE\${TNAME}-RV "Install_Dir" "$INSTDIR\Theaters\${TNAME}"
ReadRegStr $INSTDIR HKLM "SOFTWARE\${TNAME}-RV" "Install_Dir"
ReadRegStr $F4Root HKLM "Software\MicroProse\Falcon\4.0" "basedir"
StrCpy $1 "$F4Root\campaign\save"
StrCpy $2 "$INSTDIR\utilidades\LxNormalFix.exe @${TNAME} @$INSTDIR\terrdata"
; Escribimos los registros de instalación dentro del directorio del registro
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "InstallDir" "$INSTDIR"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "DisplayName" "${APP_NAME}-RV"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "UninstallString" "$INSTDIR/uninstall-${TNAME}-RV.exe"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "DisplayIcon" "$INSTDIR\${TNAME}.ico"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "Publisher" "F4Spain/F4Portugal"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "HelpLink" "www.f4spain.com"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV" "Comments" "Teatro para Falcon AF/OF/RV de la Península Ibérica, Islas Baleares, Canarias, Azores y Norte de África"
;Para crear un enlace directo en el escritorio al Manual del usuario.
MessageBox MB_YESNO "¿Desearás un enlace en el escritorio al Manual del usuario?" IDYES Enlace3 IDNO Prefinish2
Enlace3:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
CreateShortCut "$DESKTOP\Manual del usuario ${APP_NAME}-RV.lnk" "$INSTDIR\Manuales\Manualdelusuario.pdf"
Prefinish2:
MessageBox MB_YESNO "¿Desearás un enlace en el escritorio al Desinstalador?" IDYES Enlace4 IDNO CreateDirs
Enlace4:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
CreateShortCut "$DESKTOP\Desinstalador ${APP_NAME}-RV.lnk" "$INSTDIR\Uninstall-${TNAME}-RV.exe"
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "Instalación en un paso.Tarda bastante. Cierra todos los programas y deshabilita el protector de pantalla" "Instalar ${TNAME}" "Cancelar"
Pop $0
IntCmp $0 2 cancelRV
Goto CreateDirs
CancelRV:
Delete "$DESKTOP\Manual del usuario ${APP_NAME}-RV.lnk"
Delete "$DESKTOP\Desinstalador ${APP_NAME}-RV.lnk"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-RV"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "SOFTWARE\${TNAME}-RV"
Goto Cancel
;OF INSTALL
F4Install:
WriteRegStr HKLM SOFTWARE\${TNAME}-OF "Install_Dir" "$INSTDIR\Theaters\${TNAME}"
ReadRegStr $INSTDIR HKLM "SOFTWARE\${TNAME}-OF" "Install_Dir"
ReadRegStr $F4Root HKLM "Software\MicroProse\Falcon\4.0" "basedir"
StrCpy $1 "$F4Root\campaign\save"
StrCpy $2 "$INSTDIR\utilidades\LxNormalFix.exe @${TNAME} @$INSTDIR\terrdata"
; Escribimos los registros de instalación dentro del directorio del registro
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "InstallDir" "$INSTDIR"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "DisplayName" "${APP_NAME}-OF"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "UninstallString" "$INSTDIR/uninstall-${TNAME}-OF.exe"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "DisplayIcon" "$INSTDIR\${TNAME}.ico"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "Publisher" "F4Spain/F4Portugal"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "HelpLink" "www.f4spain.com"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF" "Comments" "Teatro para Falcon AF/OF/RV de la Península Ibérica, Islas Baleares, Canarias, Azores y Norte de África"
;Para crear un enlace directo en el escritorio al Manual del usuario.
MessageBox MB_YESNO "¿Desearás un enlace en el escritorio al Manual del usuario?" IDYES Enlace5 IDNO Prefinish3
Enlace5:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
CreateShortCut "$DESKTOP\Manual del usuario ${APP_NAME}-OF.lnk" "$INSTDIR\Manuales\Manualdelusuario.pdf"
Prefinish3:
MessageBox MB_YESNO "¿Desearás un enlace en el escritorio al Desinstalador?" IDYES Enlace6 IDNO CreateDirs
Enlace6:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
CreateShortCut "$DESKTOP\Desinstalador ${APP_NAME}-OF.lnk" "$INSTDIR\Uninstall-${TNAME}-OF.exe"
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "Instalación en un paso.Tarda bastante. Cierra todos los programas y deshabilita el protector de pantalla" "Instalar ${TNAME}" "Cancelar"
Pop $0
IntCmp $0 2 cancelOF
Goto CreateDirs
CancelOF:
Delete "$DESKTOP\Manual del usuario ${APP_NAME}-OF.lnk"
Delete "$DESKTOP\Desinstalador ${APP_NAME}-OF.lnk"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-OF"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "SOFTWARE\${TNAME}-OF"
Goto Cancel
;CREACIÓN DIRECTORIOS AF/RV/OF
CreateDirs:
SetOutPath $F4Root
CreateDirectory "$F4root\Theaters\${TNAME}\campaign\${TNAME}1"
CreateDirectory "$F4root\Theaters\${TNAME}\campaign\${TNAME}2"
CreateDirectory "$F4root\Theaters\${TNAME}\campaign\${TNAME}3"
CreateDirectory "$F4root\Theaters\${TNAME}\terrdata\weather\"
CreateDirectory "$F4root\Theaters\${TNAME}\objects\"
SetOutPath $INSTDIR
CopyFiles /filesonly "$1\*.pri" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.txt" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.b" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.db" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.ia" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.dfs" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.gbd" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.lst" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.idx" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\*.wch" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\atc.ini" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\falcon4.aii" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\falcon4.rt" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\falcon4.tt" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$1\validac.*" "$INSTDIR\campaign\${TNAME}1\"
; database objects (same dir for all versions)
; this needs to be recursively because RV has koreaobj subdir.
CopyFiles "$F4Root\terrdata\objects\*.*" "$INSTDIR\objects\"
CopyFiles "$F4Root\terrdata\korea\weather\*.*" "$INSTDIR\terrdata\weather\"
; then copy it to the two another campaign dirs
CopyFiles /filesonly "$INSTDIR\campaign\${TNAME}1\*.*" "$INSTDIR\campaign\${TNAME}2\"
CopyFiles /filesonly "$INSTDIR\campaign\${TNAME}1\*.*" "$INSTDIR\campaign\${TNAME}3\"
CopyFiles "$F4Root\terrdata\korea\weather\*.*" "$INSTDIR\terrdata\weather\"
;CARPETA DE NUESTRO PC DONDE ESTÁN LOS ARCHIVOS DEL TEATRO
File /r "F:\F4SPAIN\BETAS\THEATERS\${TNAME}\*.*"
;COMMON campaign files
CopyFiles /filesonly "$INSTDIR\campaign\common\*.*" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles /filesonly "$INSTDIR\campaign\common\*.*" "$INSTDIR\campaign\${TNAME}2\"
CopyFiles /filesonly "$INSTDIR\campaign\common\*.*" "$INSTDIR\campaign\${TNAME}3\"
; beginning of falcon version DATABASE & UI AF/RV/OF
; database copy
StrCmp $F4subver "OF" DataBaseOF
StrCmp $F4subver "RV" DataBaseRV
; UI AF
CopyFiles "$INSTDIR\art\art-AF\*.*" "$INSTDIR\art\art\"
; database AF y borrado uninstalls sobrantes
CopyFiles "$INSTDIR\objects\AF\*.*" "$INSTDIR\objects\"
CopyFiles "$INSTDIR\campaign\common-AF\*.*" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles "$INSTDIR\campaign\common-AF\*.*" "$INSTDIR\campaign\${TNAME}2\"
CopyFiles "$INSTDIR\campaign\common-AF\*.*" "$INSTDIR\campaign\${TNAME}3\"
Delete "$INSTDIR\Uninstall-${TNAME}-RV.exe"
Delete "$INSTDIR\Uninstall-${TNAME}-OF.exe"
goto EndOfDataBaseCopy
DataBaseOF:
; UI OF
; copy only one \art\ as we have the art1024 dir there too, heh hmm.
CopyFiles "$INSTDIR\art\art-OF\*.*" "$INSTDIR\art\"
; database OF y borrado uninstalls sobrantes
CopyFiles "$INSTDIR\objects\OF\*.*" "$INSTDIR\objects\"
CopyFiles "$INSTDIR\campaign\common-OF\*.*" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles "$INSTDIR\campaign\common-OF\*.*" "$INSTDIR\campaign\${TNAME}2\"
CopyFiles "$INSTDIR\campaign\common-OF\*.*" "$INSTDIR\campaign\${TNAME}3\"
Delete "$INSTDIR\Uninstall-${TNAME}-RV.exe"
Delete "$INSTDIR\Uninstall-${TNAME}-AF.exe"
goto EndOfDataBaseCopy
DataBaseRV:
; UI RV
CopyFiles "$INSTDIR\art\art-RV\*.*" "$INSTDIR\art\art\"
; database RV y borrado uninstalls sobrantes
CopyFiles "$INSTDIR\objects\RV\*.*" "$INSTDIR\objects\"
CopyFiles "$INSTDIR\campaign\common-RV\*.*" "$INSTDIR\campaign\${TNAME}1\"
CopyFiles "$INSTDIR\campaign\common-RV\*.*" "$INSTDIR\campaign\${TNAME}2\"
CopyFiles "$INSTDIR\campaign\common-RV\*.*" "$INSTDIR\campaign\${TNAME}3\"
Delete "$INSTDIR\Uninstall-${TNAME}-AF.exe"
Delete "$INSTDIR\Uninstall-${TNAME}-OF.exe"
EndOfDataBaseCopy:
RMDir /r "$INSTDIR\objects\AF\"
RMDir /r "$INSTDIR\objects\RV\"
RMDir /r "$INSTDIR\objects\OF\"
RMDir /r "$INSTDIR\art\art-AF\"
RMDir /r "$INSTDIR\art\art-RV\"
RMDir /r "$INSTDIR\art\art-OF\"
RMDir /r "$INSTDIR\campaign\common-AF\"
RMDir /r "$INSTDIR\campaign\common-OF\"
RMDir /r "$INSTDIR\campaign\common-RV\"
RMDir /r "$INSTDIR\campaign\common\"
; end of falcon version DATABASE & UI
StrCmp $F4ver "F4" F4curTheater TheaterAdmin
StrCpy $ErrCode "Unknown error before curTheater: $F4ver."
Goto Error
F4curTheater:
; set current theater to new theater PARA QUE POH
; this reads the specified registry value into $3 for use later
ReadRegStr $3 HKLM "Software\MicroProse\Falcon\4.0" "curTheater"
${registry::Write} "HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "${TNAME}1" "REG_SZ" $R0
; if it is an OF install, skip straight to theater admin otherwise, do RV stuff
StrCmp $F4subver "OF" TheaterAdmin
; APLICACIÓN UTILIDADES
TheaterAdmin:
SetOutPath "$INSTDIR\utilidades"
; plus additional two lstupdate entries
ExecWait "$INSTDIR\Utilidades\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$INSTDIR\Utilidades\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$INSTDIR\Utilidades\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}3.tdf"
ExecWait '$INSTDIR\Utilidades\SPTinstall.exe -auto "$INSTDIR\terrdata"'
ExecWait '$INSTDIR\Utilidades\BaZT-SRTM-Theater.exe "$INSTDIR" "$INSTDIR\terrdata"'
ExecWait "$INSTDIR\Utilidades\LxNormalFix.exe $2"
; just compress textures if F4 then finish
StrCmp $F4ver "AF" Clear
; CONVERSIÓN A DDS (SÓLO EN RV Y OF)
ExecWait "$INSTDIR\utilidades\SeasonSwitcher.exe -0"
; el anterior teatro activo vuelve a activarse. Se deja la instalación de Falcon tal como estaba.
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "$3" "REG_SZ" $R0
; FINALIZACIÓN
Clear:
; Se borran las carpetas que ya no se usarán
SetOutPath $INSTDIR
RMDir /r "$INSTDIR\Utilidades\"
StrCmp $F4ver "F4" Finish
StrCmp $F4ver "AF" Finish
Cancel:
Messagebox::show MB_DEFBUTTON1|MB_TOPMOST "" "" "Instalación de ${TNAME} cancelada por el usuario" "Ok"
Goto Finish
Error:
Messagebox MB_OK $ErrCode
Finish:
SectionEnd
UNINSTALLER POH AF
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;DEFINICIÓN DE PARÁMETROS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;NOTA: este desinstalador hay que colocarlo en la raíz de la carpeta del teatro
!define TNAME "POH"
!define APP_NAME "Pillars of Hercules Theater"
!define INSTDIR_REG_ROOT "HKLM"
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
!define VERFALCON "AF"
!define F4ver "AF" ;es para lstupdate. sólo puede ser "AF" o "F4"
!include "MUI.nsh"
!insertmacro MUI_LANGUAGE "Spanish"
; branding text is just something that's displayed at the bottom of the installer
BrandingText "www.f4spain.com"
Name "${APP_NAME}"
; outfile is the name of the installer. Unless otherwise set, it will be the same directory as where the script is
OutFile "Uninstall-${TNAME}-${VERFALCON}.exe"
ShowInstDetails nevershow
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DESINSTALADOR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Section Desinstalador
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "¿Deseas desinstalar ${APP_NAME} de Falcon ${VERFALCON}? " "Sí" "No"
Pop $0
IntCmp $0 2 No
ReadRegStr $INSTDIR HKLM "SOFTWARE\${TNAME}-${VERFALCON}" "Install_Dir" ;este es la entrada de registro del teatro
IfFileExists $INSTDIR\POH.ico 0 +2 ;se comprueba que nuestro teatro esté presente
Goto +5
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "${TNAME} no se ha detectado en Falcon ${VERFALCON}. Quizá queden rastros ¿Deseas eliminar completamente el Teatro ${TNAME}?" "Sí" "No"
Pop $0
IntCmp $0 2 No
;se borrará las entradas de registro, lo enlaces directos al escritorio y todos los ficheros de nuestro teatro.
;pero antes se ejecutará lstupdate para borrar las entradas de nuestro teatro en el archivo theaters.lst
SetOutPath $INSTDIR
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}3.tdf"
SetOutPath ..\ ;subimos un nivel para que al aplicar RMDir también borre la carpeta del teatro y no sólo su contenido. Me costó horas descubrir ésto ;-)
Delete "$DESKTOP\Manual del usuario ${APP_NAME}-${VERFALCON}.lnk"
Delete "$DESKTOP\Desinstalador ${APP_NAME}-${VERFALCON}.lnk"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-${VERFALCON}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "SOFTWARE\${TNAME}-${VERFALCON}"
RMDir /REBOOTOK /r "$INSTDIR\"
MessageBox MB_YESNO|MB_ICONQUESTION "Para completar la desinstalación de ${TNAME} de Falcon ${VERFALCON} es necesario reiniciar. ¿Deseas hacerlo ahora?" IDNO +2
Reboot
Goto Finish
No:
Messagebox::show MB_DEFBUTTON1|MB_TOPMOST "" "" "Desinstalación de ${TNAME} de Falcon ${VERFALCON} cancelada" "Ok"
Goto Finish
Finish:
Sectionend
UNISTALLER POH OF
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;DEFINICIÓN DE PARÁMETROS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;NOTA: este desinstalador hay que colocarlo en la raíz de la carpeta del teatro
!define TNAME "POH"
!define APP_NAME "Pillars of Hercules Theater"
!define INSTDIR_REG_ROOT "HKLM"
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
!define VERFALCON "OF"
!define F4ver "F4" ;es para lstupdate. sólo puede ser "AF" o "F4"
!include "MUI.nsh"
!insertmacro MUI_LANGUAGE "Spanish"
; branding text is just something that's displayed at the bottom of the installer
BrandingText "www.f4spain.com"
Name "${APP_NAME}"
; outfile is the name of the installer. Unless otherwise set, it will be the same directory as where the script is
OutFile "Uninstall-${TNAME}-${VERFALCON}.exe"
ShowInstDetails nevershow
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DESINSTALADOR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Section Desinstalador
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "¿Deseas desinstalar ${APP_NAME} de Falcon ${VERFALCON}? " "Sí" "No"
Pop $0
IntCmp $0 2 No
ReadRegStr $INSTDIR HKLM "SOFTWARE\${TNAME}-${VERFALCON}" "Install_Dir" ;este es la entrada de registro del teatro
IfFileExists $INSTDIR\POH.ico 0 +2 ;se comprueba que nuestro teatro esté presente
Goto +5
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "${TNAME} no se ha detectado en Falcon ${VERFALCON}. Quizá queden rastros ¿Deseas eliminar completamente el Teatro ${TNAME}?" "Sí" "No"
Pop $0
IntCmp $0 2 No
;se borrará las entradas de registro, lo enlaces directos al escritorio y todos los ficheros de nuestro teatro.
;pero antes se ejecutará lstupdate para borrar las entradas de nuestro teatro en el archivo theaters.lst
SetOutPath $INSTDIR
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}3.tdf"
SetOutPath ..\ ;subimos un nivel para que al aplicar RMDir también borre la carpeta del teatro y no sólo su contenido. Me costó horas descubrir ésto ;-)
Delete "$DESKTOP\Manual del usuario ${APP_NAME}-${VERFALCON}.lnk"
Delete "$DESKTOP\Desinstalador ${APP_NAME}-${VERFALCON}.lnk"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-${VERFALCON}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "SOFTWARE\${TNAME}-${VERFALCON}"
RMDir /REBOOTOK /r "$INSTDIR\"
MessageBox MB_YESNO|MB_ICONQUESTION "Para completar la desinstalación de ${TNAME} de Falcon ${VERFALCON} es necesario reiniciar. ¿Deseas hacerlo ahora?" IDNO +2
Reboot
Goto Finish
No:
Messagebox::show MB_DEFBUTTON1|MB_TOPMOST "" "" "Desinstalación de ${TNAME} de Falcon ${VERFALCON} cancelada" "Ok"
Goto Finish
Finish:
Sectionend
UNISTALLER POH RV
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;DEFINICIÓN DE PARÁMETROS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;NOTA: este desinstalador hay que colocarlo en la raíz de la carpeta del teatro
!define TNAME "POH"
!define APP_NAME "Pillars of Hercules Theater"
!define INSTDIR_REG_ROOT "HKLM"
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
!define VERFALCON "RV"
!define F4ver "F4" ;es para lstupdate. sólo puede ser "AF" o "F4"
!include "MUI.nsh"
!insertmacro MUI_LANGUAGE "Spanish"
; branding text is just something that's displayed at the bottom of the installer
BrandingText "www.f4spain.com"
Name "${APP_NAME}"
; outfile is the name of the installer. Unless otherwise set, it will be the same directory as where the script is
OutFile "Uninstall-${TNAME}-${VERFALCON}.exe"
ShowInstDetails nevershow
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DESINSTALADOR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Section Desinstalador
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "¿Deseas desinstalar ${APP_NAME} de Falcon ${VERFALCON}? " "Sí" "No"
Pop $0
IntCmp $0 2 No
ReadRegStr $INSTDIR HKLM "SOFTWARE\${TNAME}-${VERFALCON}" "Install_Dir" ;este es la entrada de registro del teatro
IfFileExists $INSTDIR\POH.ico 0 +2 ;se comprueba que nuestro teatro esté presente
Goto +5
Messagebox::show MB_DEFBUTTON2|MB_TOPMOST "" "" "${TNAME} no se ha detectado en Falcon ${VERFALCON}. Quizá queden rastros ¿Deseas eliminar completamente el Teatro ${TNAME}?" "Sí" "No"
Pop $0
IntCmp $0 2 No
;se borrará las entradas de registro, lo enlaces directos al escritorio y todos los ficheros de nuestro teatro.
;pero antes se ejecutará lstupdate para borrar las entradas de nuestro teatro en el archivo theaters.lst
SetOutPath $INSTDIR
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$INSTDIR\lstupdate.exe ${F4ver} -Theaters\${TNAME}\${TNAME}3.tdf"
SetOutPath ..\ ;subimos un nivel para que al aplicar RMDir también borre la carpeta del teatro y no sólo su contenido. Me costó horas descubrir ésto ;-)
Delete "$DESKTOP\Manual del usuario ${APP_NAME}-${VERFALCON}.lnk"
Delete "$DESKTOP\Desinstalador ${APP_NAME}-${VERFALCON}.lnk"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}-${VERFALCON}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "SOFTWARE\${TNAME}-${VERFALCON}"
RMDir /REBOOTOK /r "$INSTDIR\"
MessageBox MB_YESNO|MB_ICONQUESTION "Para completar la desinstalación de ${TNAME} de Falcon ${VERFALCON} es necesario reiniciar. ¿Deseas hacerlo ahora?" IDNO +2
Reboot
Goto Finish
No:
Messagebox::show MB_DEFBUTTON1|MB_TOPMOST "" "" "Desinstalación de ${TNAME} de Falcon ${VERFALCON} cancelada" "Ok"
Goto Finish
Finish:
Sectionend