Unverified Commit 97965b7e authored by Maxime FRIESS's avatar Maxime FRIESS 💙
Browse files

[build] Create a windows installer

parent 5a0f7d55
image: node:lts
image: node:lts-bullseye
stages:
- build
......@@ -7,17 +7,17 @@ stages:
sonarqube-check:
stage: test
image:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
script:
- sonar-scanner
allow_failure: true
only:
......@@ -41,15 +41,17 @@ compile:
paths:
- node_modules/
- cache/
before_script:
- apt-get -qq update && apt-get -qq install -y nsis
script:
- yarn install
- yarn build
- tar -czvf build/linux64.tar.gz build/t432_las21_t3_b/linux64/
- tar -czvf build/win64.tar.gz build/t432_las21_t3_b/win64/
- makensis installer.nsh
artifacts:
paths:
- build/linux64.tar.gz
- build/win64.tar.gz
- build/Installer.exe
pages:
stage: deploy
......
; Script de création d'un installeur
Name "LAS21-B Ver. 1.0"
; Pages à afficher
Page license
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
; Variables globales
!define MUI_PRODUCT "LAS21-B Ver. 1.0"
!define MUI_FILE "t432_las21_t3_b"
!define MUI_VERSION ""
!define MUI_BRANDINGTEXT "LAS21-B Ver. 1.0"
CRCCheck On
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
OutFile "build/Installer.exe"
ShowInstDetails "nevershow"
ShowUninstDetails "nevershow"
SetCompressor "bzip2"
LicenseData "LICENSE.txt"
; Section installeur
Section "install"
; Ajout des fichiers
SetOutPath "$INSTDIR"
File /r "build/t432_las21_t3_b/win64/*"
File "LICENSE.txt"
; Lien bureau
CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0
; Entrées registres désinstalleur
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
; Section désinstalleur
Section "Uninstall"
; Suppression des fichiers
RMDir /r "$INSTDIR\*.*"
RMDir "$INSTDIR"
; Suppression des raccourcis
Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
RmDir "$SMPROGRAMS\${MUI_PRODUCT}"
; Suppression des clés de registre
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
SectionEnd
; Message affichés à la fin de l'install
Function .onInstSuccess
MessageBox MB_OK "Merci d'avoir installé ${MUI_PRODUCT}!"
FunctionEnd
; Message affichés à la fin de la desinstall
Function un.onUninstSuccess
MessageBox MB_OK "Vous avez désinstallé ${MUI_PRODUCT}... :'("
FunctionEnd
; Forcer le français
Function .onInit
StrCpy $LANGUAGE 1036
FunctionEnd
Supports Markdown
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