Commit da53c479 authored by LawnCable's avatar LawnCable
Browse files

Move2electron builder

parent 25b56731
image: electronuserland/builder:wine
cache:
paths:
- node_modules/
stages:
- prepare
- build
- package
npmi:
stage: prepare
script:
- npm install
build:
stage: build
script:
- npm run build
electron-builder:
stage: package
script:
- npm run package
artifacts:
paths:
- "out/**"
- "out/ManaLauncher **"
- "out/ManaLauncher**.AppImage"
- "out/ManaLauncher**.exe"
;--------------------------------
;Include Modern UI
;http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html
!include "MUI2.nsh"
;--------------------------------
;General
;Name and file
Name "ManaLauncher"
OutFile "InstallManaLauncher.exe"
!define MUI_ICON "assets\media\icon.ico"
;Default installation folder
InstallDir "$PROGRAMFILES\ManaLauncher"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\LawnCablesManaLauncher" ""
;Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "LICENSE"
;!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Function finishpageaction
CreateShortcut "$Desktop\LawnCablesManaLauncher.lnk" "$INSTDIR\LawnCablesManaLauncher.exe"
FunctionEnd
!define MUI_FINISHPAGE_RUN $INSTDIR\LawnCablesManaLauncher.exe
!define MUI_FINISHPAGE_RUN_TEXT "Launch ManaLauncher"
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpageaction
!insertmacro MUI_PAGE_FINISH
!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.ModifyUnWelcome
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.LeaveUnWelcome
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
Var checkbox
var CheckboxState
Function un.onInit
StrCpy $CheckboxState ${BST_CHECKED}
FunctionEnd
Function un.ModifyUnWelcome
${NSD_CreateCheckbox} 120u -20u 50% 20u "Keep Gamedata and Configuration Files"
Pop $checkbox
SetCtlColors $checkbox "" ${MUI_BGCOLOR}
${NSD_SetState} $checkbox $CheckboxState
FunctionEnd
Function un.LeaveUnWelcome
${NSD_GetState} $checkbox $CheckboxState
FunctionEnd
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
!define REG_UNISTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\LawnCablesManaLauncher"
Section "Install"
SetOutPath "$INSTDIR"
File /r "out\LawnCablesManaLauncher-win32-x64\*"
File "assets\media\icon.ico"
;Store installation folder
WriteRegStr HKCU "Software\LawnCablesManaLauncher" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM ${REG_UNISTALL_KEY} "DisplayName" "LawnCable's ManaLauncher"
WriteRegStr HKLM ${REG_UNISTALL_KEY} "Publisher" "TMW2.ORG -> ManaLauncher Team"
WriteRegStr HKLM ${REG_UNISTALL_KEY} "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM ${REG_UNISTALL_KEY} "DisplayIcon" "$\"$INSTDIR\icon.ico$\""
WriteRegStr HKLM ${REG_UNISTALL_KEY} "URLInfoAbout" "https://tmw2.org"
WriteRegDWORD HKLM ${REG_UNISTALL_KEY} "NoModify" 1
WriteRegDWORD HKLM ${REG_UNISTALL_KEY} "NoRepair" 1
WriteRegStr HKLM ${REG_UNISTALL_KEY} "UpdateInfo" "https://tmw2.org"
;Create shortcut
CreateShortcut "$SMPROGRAMS\LawnCablesManaLauncher.lnk" "$INSTDIR\LawnCablesManaLauncher.exe"
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
RMDir /r "$INSTDIR"
${If} $CheckboxState <> ${BST_CHECKED}
RMDir /r "$APPDATA\mana-launcher"
${EndIf}
Delete "$Desktop\LawnCablesManaLauncher.lnk"
Delete "$SMPROGRAMS\LawnCablesManaLauncher.lnk"
DeleteRegKey /ifempty HKCU "Software\LawnCablesManaLauncher"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LawnCablesManaLauncher"
Delete "$INSTDIR\Uninstall.exe"
RMDir /r "$INSTDIR"
SectionEnd
......@@ -11,12 +11,9 @@ npm start
### Package & Installer instructions
Windows:
`npm run package` to package for all suported platforms at once
- You need to have NSIS Installed
1. `npm run package`
2. run the `LawncableLauncher.nsi`-script with NSIS
Info: you need `wine` to cross build from linux for windows (https://www.electron.build/multi-platform-build#linux)
## Implemented Features
......@@ -43,8 +40,6 @@ Windows:
### TODO
- finish Updater for ManaPlus
- Do the client_data update with the Launcher and add ability to add simple "Texture packs" (the client_data and texturpack folder get merged an passed to the client)
- Login with Game Account (only TMW2 server)
......@@ -56,8 +51,6 @@ Windows:
- For saving the login information
- And for other things like that the launcher has access to the login so that he can send a teleport request to the server (required for the rich present thing)
- Auto update of manaplus
- adding custom gameservers
### Idea-State
......@@ -73,5 +66,4 @@ Windows:
## Notes / command reference
`electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]`
this for icon?:``--icon=src/assets/images/icon.ico`
appId: org.tmw2.manalauncher
productName: ManaLauncher
directories:
output: out
win:
target:
- target: nsis
arch:
- x64
- target: portable
arch:
- x64
linux:
target:
- target: appimage
arch:
- x64
- arm64
This diff is collapsed.
{
"name": "mana-launcher",
"version": "1.0.2",
"version": "1.1.0",
"private": true,
"homepage": "https://tmw2.org",
"description": "A launcher for manaplus.",
......@@ -9,14 +9,14 @@
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc",
"start": "npm run build && electron .",
"package": "npm run build && electron-packager . LawnCablesManaLauncher --arch=x64 --out=./out --overwrite --ignore=\"LawncableLauncher.nsi|Readme.md|tsconfig.json|tslint.json|.gitignore|InstallManaLauncher.exe\" --icon=assets/media/icon.ico"
"package": "npm run build && electron-builder build -wl"
},
"postinstall": "electron-builder install-app-deps",
"author": "LawnCable",
"license": "GNU GPLv3",
"devDependencies": {
"electron": "^2.0.1",
"electron-packager": "^12.1.0",
"ncp": "^2.0.0",
"electron-builder": "^20.39.0",
"typescript": "^2.8.3"
},
"files": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment