From 957f18303641220e106d2f98f91ecc3ecab727fb Mon Sep 17 00:00:00 2001 From: LawnCable Date: Mon, 25 Jun 2018 02:37:15 +0200 Subject: Added a way to make a installer (Not working perfectly yet - It's more like experimental state atm) --- .gitignore | 1 + LawncableLauncher.nsi | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++ Readme.md | 4 ++ 3 files changed, 122 insertions(+) create mode 100644 LawncableLauncher.nsi diff --git a/.gitignore b/.gitignore index 2b1906d..6f02025 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist out +InstallManaLauncher.exe diff --git a/LawncableLauncher.nsi b/LawncableLauncher.nsi new file mode 100644 index 0000000..7ec1d96 --- /dev/null +++ b/LawncableLauncher.nsi @@ -0,0 +1,117 @@ +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + +;-------------------------------- +;General + + ;Name and file + Name "ManaLauncher" + OutFile "InstallManaLauncher.exe" + + ;Default installation folder + InstallDir "$PROGRAMFILES\ManaLauncher" + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\ManaLauncher" "" + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin + +;-------------------------------- +;Variables + + Var StartMenuFolder + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !insertmacro MUI_PAGE_LICENSE "LICENSE" + ;!insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + + ;Start Menu Folder Page Configuration + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\LawnCablesManaLauncher" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + + !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder + + !insertmacro MUI_PAGE_INSTFILES + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + + Function finishpageaction + CreateShortcut "$Desktop\LawnCablesManaLauncher.lnk" "$INSTDIR\LawnCablesManaLauncher.exe" + FunctionEnd + + !define MUI_FINISHPAGE_SHOWREADME "" + !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + !define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut" + !define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpageaction + + !insertmacro MUI_PAGE_FINISH + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Installer Sections + +Section "Install" + + SetOutPath "$INSTDIR" + + File /r "out\LawnCablesManaLauncher-win32-x64\*" + + ;Store installation folder + WriteRegStr HKCU "Software\LawnCablesManaLauncher" "" $INSTDIR + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\$StartMenuFolder" + CreateShortcut "$SMPROGRAMS\$StartMenuFolder\LawnCablesManaLauncher.lnk" "$INSTDIR\LawnCablesManaLauncher.exe" + CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + + + + !insertmacro MUI_STARTMENU_WRITE_END + +SectionEnd + + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + ;ADD YOUR OWN FILES HERE... + + Delete "$INSTDIR\Uninstall.exe" + + RMDir /r "$INSTDIR" + + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder + + Delete "$Desktop\LawnCablesManaLauncher.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\LawnCablesManaLauncher.lnk" + RMDir "$SMPROGRAMS\$StartMenuFolder" + + DeleteRegKey /ifempty HKCU "Software\LawnCablesManaLauncher" + +SectionEnd diff --git a/Readme.md b/Readme.md index 9862c48..e22a9c9 100644 --- a/Readme.md +++ b/Readme.md @@ -5,6 +5,10 @@ Start instructions: npm i npm start ``` +Package & Installer instructions: +- You need to have NSIS Installed +1. `npm run package` +2. run the `LawncableLauncher.nsi`script with NSIS # Implemented Features - A server selection that contains the socialLinks of the server and a short description -- cgit v1.2.3-70-g09d2