From 74d019666f8fa574babf04d8d5134e4546bfa80c Mon Sep 17 00:00:00 2001 From: CarJem Generations Date: Mon, 17 Feb 2020 19:47:34 -0500 Subject: [PATCH] Last Commits of the Night --- ...=> ManiacEditor-GenerationsEdition-V2.nsi} | 118 +++++++----------- Installer/ManiacEditor-GenerationsEdition.nsi | 115 ++++++++++------- ManiacEditor/Properties/AssemblyInfo.cs | 6 +- .../Properties/Versioning/build_list.json | 4 +- 4 files changed, 122 insertions(+), 121 deletions(-) rename Installer/{PrototypeInstaller.nsi => ManiacEditor-GenerationsEdition-V2.nsi} (70%) diff --git a/Installer/PrototypeInstaller.nsi b/Installer/ManiacEditor-GenerationsEdition-V2.nsi similarity index 70% rename from Installer/PrototypeInstaller.nsi rename to Installer/ManiacEditor-GenerationsEdition-V2.nsi index e6aa5d69..2a3a8b86 100644 --- a/Installer/PrototypeInstaller.nsi +++ b/Installer/ManiacEditor-GenerationsEdition-V2.nsi @@ -2,8 +2,6 @@ ; Headers !include "MUI2.nsh" -!include "LogicLib.nsh" -!include "FileFunc.nsh" ;-------------------------------- ; Defintions @@ -24,18 +22,12 @@ !define INSTALLER_DEST_FILE "Setup.exe" !define INSTALLER_DEST_DIR "D:\Users\CarJem\source\rsdk_repos\ManiacEditor-GenerationsEdition\Installer" !define INSTALLER_DEST "${INSTALLER_DEST_DIR}\${INSTALLER_DEST_FILE}" -!define DEFAULT_NORMAL_DESTINATON "$PROGRAMFILES\${INSTALL_DIR_NAME}" -!define DEFAULT_PORTABLE_DESTINATON "$EXEPATH\${INSTALL_DIR_NAME}" !define INSTALL_DIR_NAME "ManiacEditor" !define MAIN_APP_EXE "ManiacEditor.exe" !define MAKE_DIRECTORY "D:\Users\CarJem\source\rsdk_repos\ManiacEditor-GenerationsEdition\ManiacEditor\bin\Release\*.*" !define STARTMENU_DIR_NAME "ManiacEditor" !define APPDATA_DIRECTORY "ManiacEditor" -Var NormalDestDir -Var PortableDestDir -Var PortableMode - ; Section Descriptors !define DESC_Section1 "Maniac Editor's Core and Essential Files" @@ -78,7 +70,8 @@ InstallDir "$PROGRAMFILES\${INSTALL_DIR_NAME}" ; Installer Pages ;--------- !insertmacro MUI_PAGE_WELCOME -Page Custom PortableModePageCreate PortableModePageLeave + +!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !ifdef REG_START_MENU @@ -94,18 +87,13 @@ Page Custom PortableModePageCreate PortableModePageLeave !define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}" !insertmacro MUI_PAGE_FINISH -;--------- - ; Uninstaller Pages ;--------- - !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH -;--------- - ;-------------------------------- ; Languages @@ -117,41 +105,68 @@ Page Custom PortableModePageCreate PortableModePageLeave Section "Essential Files" ESSENTIAL_FILES SectionIn RO SetOverwrite ifnewer -File /r "${MAKE_DIRECTORY}" SetOutPath "$INSTDIR" +File /r "${MAKE_DIRECTORY}" +SectionEnd + +Section /o "Portable Install" PORTABLE_INSTALL +SectionIn 1 + +CreateDirectory "$INSTDIR\Settings" +FileOpen $0 "$INSTDIR\Settings\internal_switches.json" w +FileWrite $0 "{$\"PortableMode$\":true}" +FileClose $0 -${If} $PortableMode = 0 - WriteUninstaller "$INSTDIR\uninstall.exe" - CreateDirectory "$SMPROGRAMS\${STARTMENU_DIR_NAME}" - CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" - CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" - CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" -${Else} - CreateDirectory "$INSTDIR\Settings" - FileOpen $0 "$INSTDIR\Settings\internal_switches.json" w - FileWrite $0 "{$\"PortableMode$\":true}" - FileClose $0 -${EndIf} +SectionEnd +Section "Standard Install" STANDARD_INSTALL +SectionIn 2 +WriteUninstaller "$INSTDIR\uninstall.exe" +CreateDirectory "$SMPROGRAMS\${STARTMENU_DIR_NAME}" +CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" +CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" +CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" SectionEnd +Function .onInit + StrCpy $1 ${STANDARD_INSTALL} +FunctionEnd + +Function .onSelChange + !insertmacro StartRadioButtons $1 + !insertmacro RadioButton ${PORTABLE_INSTALL} + !insertmacro RadioButton ${STANDARD_INSTALL} + !insertmacro EndRadioButtons +FunctionEnd + ;-------------------------------- ; Uninstall Section Section "Un.Essential Files" UN_ESSENTIAL_FILES SectionIn RO + +RmDir /r "$INSTDIR" + +SectionEnd + +Section /o "Un.Application Data" UN_APP_DATA + +RmDir /r "$APPDATA\${APPDATA_DIRECTORY}" + +SectionEnd + +Section "Un.Shortcuts and Uninstaller" UN_SHORTCUTS +SectionIn RO + Delete "$SMPROGRAMS\${STARTMENU_DIR_NAME}\${APP_NAME}.lnk" Delete "$SMPROGRAMS\${STARTMENU_DIR_NAME}\Uninstall ${APP_NAME}.lnk" Delete "$DESKTOP\${APP_NAME}.lnk" RmDir "$SMPROGRAMS\${STARTMENU_DIR_NAME}" + DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}" DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}" -RmDir /r "$INSTDIR" -SectionEnd -Section /o "Un.Application Data" UN_APP_DATA -RmDir /r "$APPDATA\${APPDATA_DIRECTORY}" SectionEnd ;-------------------------------- @@ -169,45 +184,4 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${UN_SHORTCUTS} "${DESC_Section5}" !insertmacro MUI_UNFUNCTION_DESCRIPTION_END -;-------------------------------- -; Portable Mode Selection Page - -Function SetModeDestinationFromInstdir -${If} $PortableMode = 0 - StrCpy $NormalDestDir $InstDir -${Else} - StrCpy $PortableDestDir $InstDir -${EndIf} -FunctionEnd - -Function PortableModePageCreate -Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory -!insertmacro MUI_HEADER_TEXT "Install Mode" "Choose how you want to install ${APP_NAME}." -nsDialogs::Create 1018 -Pop $0 -${NSD_CreateLabel} 0 10u 100% 24u "Select install mode:" -Pop $0 -${NSD_CreateRadioButton} 30u 50u -30u 8u "Normal install" -Pop $1 -${NSD_CreateRadioButton} 30u 70u -30u 8u "Portable" -Pop $2 -${If} $PortableMode = 0 - SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0 -${Else} - SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0 -${EndIf} -nsDialogs::Show -FunctionEnd - -Function PortableModePageLeave -${NSD_GetState} $1 $0 -${If} $0 <> ${BST_UNCHECKED} - StrCpy $PortableMode 0 - StrCpy $InstDir $NormalDestDir -${Else} - StrCpy $PortableMode 1 - StrCpy $InstDir $PortableDestDir -${EndIf} -FunctionEnd - ;-------------------------------- \ No newline at end of file diff --git a/Installer/ManiacEditor-GenerationsEdition.nsi b/Installer/ManiacEditor-GenerationsEdition.nsi index 2a3a8b86..621e24d5 100644 --- a/Installer/ManiacEditor-GenerationsEdition.nsi +++ b/Installer/ManiacEditor-GenerationsEdition.nsi @@ -2,6 +2,8 @@ ; Headers !include "MUI2.nsh" +!include "LogicLib.nsh" +!include "FileFunc.nsh" ;-------------------------------- ; Defintions @@ -22,12 +24,18 @@ !define INSTALLER_DEST_FILE "Setup.exe" !define INSTALLER_DEST_DIR "D:\Users\CarJem\source\rsdk_repos\ManiacEditor-GenerationsEdition\Installer" !define INSTALLER_DEST "${INSTALLER_DEST_DIR}\${INSTALLER_DEST_FILE}" +!define DEFAULT_NORMAL_DESTINATON "$PROGRAMFILES\${INSTALL_DIR_NAME}" +!define DEFAULT_PORTABLE_DESTINATON "$EXEPATH\${INSTALL_DIR_NAME}" !define INSTALL_DIR_NAME "ManiacEditor" !define MAIN_APP_EXE "ManiacEditor.exe" !define MAKE_DIRECTORY "D:\Users\CarJem\source\rsdk_repos\ManiacEditor-GenerationsEdition\ManiacEditor\bin\Release\*.*" !define STARTMENU_DIR_NAME "ManiacEditor" !define APPDATA_DIRECTORY "ManiacEditor" +Var NormalDestDir +Var PortableDestDir +Var PortableMode + ; Section Descriptors !define DESC_Section1 "Maniac Editor's Core and Essential Files" @@ -70,8 +78,7 @@ InstallDir "$PROGRAMFILES\${INSTALL_DIR_NAME}" ; Installer Pages ;--------- !insertmacro MUI_PAGE_WELCOME - -!insertmacro MUI_PAGE_COMPONENTS +Page Custom PortableModePageCreate PortableModePageLeave !insertmacro MUI_PAGE_DIRECTORY !ifdef REG_START_MENU @@ -87,13 +94,18 @@ InstallDir "$PROGRAMFILES\${INSTALL_DIR_NAME}" !define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}" !insertmacro MUI_PAGE_FINISH +;--------- + ; Uninstaller Pages ;--------- + !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH +;--------- + ;-------------------------------- ; Languages @@ -107,66 +119,40 @@ SectionIn RO SetOverwrite ifnewer SetOutPath "$INSTDIR" File /r "${MAKE_DIRECTORY}" -SectionEnd - -Section /o "Portable Install" PORTABLE_INSTALL -SectionIn 1 -CreateDirectory "$INSTDIR\Settings" -FileOpen $0 "$INSTDIR\Settings\internal_switches.json" w -FileWrite $0 "{$\"PortableMode$\":true}" -FileClose $0 -SectionEnd +${If} $PortableMode = 0 + WriteUninstaller "$INSTDIR\uninstall.exe" + CreateDirectory "$SMPROGRAMS\${STARTMENU_DIR_NAME}" + CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" + CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" + CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" +${Else} + CreateDirectory "$INSTDIR\Settings" + FileOpen $0 "$INSTDIR\Settings\internal_switches.json" w + FileWrite $0 "{$\"PortableMode$\":true}" + FileClose $0 +${EndIf} -Section "Standard Install" STANDARD_INSTALL -SectionIn 2 -WriteUninstaller "$INSTDIR\uninstall.exe" -CreateDirectory "$SMPROGRAMS\${STARTMENU_DIR_NAME}" -CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" -CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" -CreateShortCut "$SMPROGRAMS\${STARTMENU_DIR_NAME}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" SectionEnd -Function .onInit - StrCpy $1 ${STANDARD_INSTALL} -FunctionEnd - -Function .onSelChange - !insertmacro StartRadioButtons $1 - !insertmacro RadioButton ${PORTABLE_INSTALL} - !insertmacro RadioButton ${STANDARD_INSTALL} - !insertmacro EndRadioButtons -FunctionEnd - ;-------------------------------- ; Uninstall Section Section "Un.Essential Files" UN_ESSENTIAL_FILES SectionIn RO - -RmDir /r "$INSTDIR" - -SectionEnd - -Section /o "Un.Application Data" UN_APP_DATA - -RmDir /r "$APPDATA\${APPDATA_DIRECTORY}" - -SectionEnd - -Section "Un.Shortcuts and Uninstaller" UN_SHORTCUTS -SectionIn RO - Delete "$SMPROGRAMS\${STARTMENU_DIR_NAME}\${APP_NAME}.lnk" Delete "$SMPROGRAMS\${STARTMENU_DIR_NAME}\Uninstall ${APP_NAME}.lnk" Delete "$DESKTOP\${APP_NAME}.lnk" RmDir "$SMPROGRAMS\${STARTMENU_DIR_NAME}" - DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}" DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}" +RmDir /r "$INSTDIR" +SectionEnd +Section /o "Un.Application Data" UN_APP_DATA +RmDir /r "$APPDATA\${APPDATA_DIRECTORY}" SectionEnd ;-------------------------------- @@ -184,4 +170,45 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${UN_SHORTCUTS} "${DESC_Section5}" !insertmacro MUI_UNFUNCTION_DESCRIPTION_END +;-------------------------------- +; Portable Mode Selection Page + +Function SetModeDestinationFromInstdir +${If} $PortableMode = 0 + StrCpy $NormalDestDir $InstDir +${Else} + StrCpy $PortableDestDir $InstDir +${EndIf} +FunctionEnd + +Function PortableModePageCreate +Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory +!insertmacro MUI_HEADER_TEXT "Install Mode" "Choose how you want to install ${APP_NAME}." +nsDialogs::Create 1018 +Pop $0 +${NSD_CreateLabel} 0 10u 100% 24u "Select install mode:" +Pop $0 +${NSD_CreateRadioButton} 30u 50u -30u 8u "Normal install" +Pop $1 +${NSD_CreateRadioButton} 30u 70u -30u 8u "Portable" +Pop $2 +${If} $PortableMode = 0 + SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0 +${Else} + SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0 +${EndIf} +nsDialogs::Show +FunctionEnd + +Function PortableModePageLeave +${NSD_GetState} $1 $0 +${If} $0 <> ${BST_UNCHECKED} + StrCpy $PortableMode 0 + StrCpy $InstDir $NormalDestDir +${Else} + StrCpy $PortableMode 1 + StrCpy $InstDir $PortableDestDir +${EndIf} +FunctionEnd + ;-------------------------------- \ No newline at end of file diff --git a/ManiacEditor/Properties/AssemblyInfo.cs b/ManiacEditor/Properties/AssemblyInfo.cs index 32b287e3..4035fc62 100644 --- a/ManiacEditor/Properties/AssemblyInfo.cs +++ b/ManiacEditor/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -// [assembly: AssemblyVersion("20.02.16.0")] -[assembly: AssemblyVersion("20.02.16.0")] -[assembly: AssemblyFileVersion("20.02.16.0")] +// [assembly: AssemblyVersion("20.02.17.5")] +[assembly: AssemblyVersion("20.02.17.5")] +[assembly: AssemblyFileVersion("20.02.17.5")] diff --git a/ManiacEditor/Properties/Versioning/build_list.json b/ManiacEditor/Properties/Versioning/build_list.json index 2fb483bb..840aeceb 100644 --- a/ManiacEditor/Properties/Versioning/build_list.json +++ b/ManiacEditor/Properties/Versioning/build_list.json @@ -6,9 +6,9 @@ "BuildNumber": 0 }, { - "LastBuilt": "2020-02-16T00:00:00-05:00", + "LastBuilt": "2020-02-17T00:00:00-05:00", "Identifier": "Maniac Editor", - "BuildNumber": 0 + "BuildNumber": 5 } ] } \ No newline at end of file