Try to generate an installer and a 64 bits version

This commit is contained in:
Manuel Cortez 2021-12-30 18:50:42 -06:00
parent 32fb52f941
commit 0fef6427ff
No known key found for this signature in database
GPG Key ID: 262CC30FA01B5CBF
2 changed files with 74 additions and 12 deletions

View File

@ -1,13 +1,46 @@
variables:
PYTHON3_32: "C:\\python38\\python.exe"
NSIS: "C:\\program files (x86)\\nsis\\makensis.exe"
stages:
- test
- generate_docs
- build
- versions
- upload
program64:
interruptible: true
tags:
- windows
- windows10
stage: build
variables:
PYTHON: "C:\\python37\\python.exe"
before_script:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME}"
- '&$env:PYTHON -V'
- '&$env:PYTHON -m pip install --upgrade pip'
- '&$env:PYTHON -m venv env'
- 'env\Scripts\Activate.ps1'
- 'python -m pip install --upgrade -r requirements.txt'
script:
- cd src
- 'python write_version_data.py'
- 'python setup.py build'
- cd ..
- 'mkdir artifacts'
- cd scripts
- 'python prepare_zipversion.py'
- cd ..
- move src\music_dl.zip artifacts\music_dl_x64.zip
- 'move src/dist artifacts/program64'
only:
- schedules
- master
artifacts:
paths:
- artifacts
expire_in: 1 day
program32:
interruptible: true
tags:
@ -29,14 +62,12 @@ program32:
- cd src
- 'python write_version_data.py'
- 'python setup.py build'
- '&$env:NSIS installer.nsi'
- cd ..
- mkdir artifacts
- move src\music_dl* artifacts
- cd scripts
- 'python prepare_zipversion.py'
- cd ..
- move src\music_dl.zip artifacts\music_dl.zip
- move src\music_dl.zip artifacts\music_dl_x86.zip
- 'move src/dist artifacts/program32'
only:
- schedules
- master
@ -45,6 +76,29 @@ program32:
- artifacts
expire_in: 1 day
generate_versions:
stage: versions
tags:
- windows
- windows10
variables:
NSIS: "C:\\program files (x86)\\nsis\\makensis.exe"
before_script:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME}"
script:
- 'cd artifacts'
- '&$env:NSIS installer.nsi'
only:
- tags
- master
- schedules
artifacts:
paths:
- artifacts
expire_in: 1 day
upload:
stage: upload
tags:

View File

@ -1,11 +1,12 @@
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "x64.nsh"
Unicode true
CRCCheck on
ManifestSupportedOS all
XPStyle on
Name "MusicDL"
OutFile "music_dl_0.7_setup.exe"
OutFile "music_dl_setup.exe"
InstallDir "$PROGRAMFILES\musicDL"
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\musicDL" "InstallLocation"
RequestExecutionLevel admin
@ -13,7 +14,7 @@ SetCompress auto
SetCompressor /solid lzma
SetDatablockOptimize on
VIAddVersionKey ProductName "MusicDL"
VIAddVersionKey LegalCopyright "Copyright 2019 - 2020 Manuel Cortez."
VIAddVersionKey LegalCopyright "Copyright 2019 - 2022 MCV Software."
VIAddVersionKey ProductVersion "0.7"
VIAddVersionKey FileVersion "0.7"
VIProductVersion "0.7.0.0"
@ -24,7 +25,7 @@ var StartMenuFolder
!insertmacro MUI_PAGE_STARTMENU startmenu $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_LINK "Visit MusicDL website"
!define MUI_FINISHPAGE_LINK_LOCATION "https://manuelcortez.net/music_dl"
!define MUI_FINISHPAGE_LINK_LOCATION "https://mcvsoftware.com/music_dl"
!define MUI_FINISHPAGE_RUN "$INSTDIR\musicDL.exe"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
@ -36,7 +37,11 @@ var StartMenuFolder
Section
SetShellVarContext All
SetOutPath "$INSTDIR"
File /r dist\*
${If} ${RunningX64}
File /r program64\*
${Else}
File /r program32\*
${EndIf}
CreateShortCut "$DESKTOP\musicDL.lnk" "$INSTDIR\musicDL.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
@ -65,5 +70,8 @@ Delete "$DESKTOP\MusicDL.lnk"
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
SectionEnd
Function .onInit
${If} ${RunningX64}
StrCpy $instdir "$programfiles64\music-dl"
${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd