nsis script to make windows installer #432

Merged
erinn merged 3 commits from nsi into master 2020-11-28 01:55:31 +00:00
4 changed files with 91 additions and 0 deletions

BIN
nsis/brand_side.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

91
nsis/cwtch-installer.nsi Normal file
View File

@ -0,0 +1,91 @@
; USAGE: Run in ui/deploy, requires the output be in 'windows' directory
!include "MUI2.nsh"
; General settings ----------------------------
Name "Cwtch"
; !define MUI_BRANDINGTEXT "SIG Beta Ver. 1.0"
Unicode True
# define the name of the installer
Outfile "cwtch-installer.exe"
erinn marked this conversation as resolved Outdated
Outdated
Review

can we get this on build.openprivacy.ca?

can we get this on build.openprivacy.ca?
Outdated
Review

yup that's the plan. Once merged I can add a nsis docker image to the server and work on configuring a drone stage to generate it and upload it :)

yup that's the plan. Once merged I can add a nsis docker image to the server and work on configuring a drone stage to generate it and upload it :)
# For removing Start Menu shortcut in Windows 7
#RequestExecutionLevel user
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)
# define the directory to install to, the desktop in this case as specified
# by the predefined $DESKTOP variable
InstallDir "$PROGRAMFILES\Cwtch"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Cwtch" "installLocation"
erinn marked this conversation as resolved Outdated
Outdated
Review

does MUI generate an uninstaller? can users remove cwtch via the windows add/remove programs panel after installing it?

does MUI generate an uninstaller? can users remove cwtch via the windows add/remove programs panel after installing it?
Outdated
Review

nsis can. this config doesn't do that. that's gonna be another project. Ideally a day, but you saw how well this one went... so.. #TODO?

nsis can. this config doesn't do that. that's gonna be another project. Ideally a day, but you saw how well this one went... so.. #TODO?
; MUI Interface -----------------------------
!define MUI_INSTALLCOLORS "DFB9DE 281831"
!define MUI_ICON "..\nsis\knot.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "..\nsis\cwtch_title.bmp"
!define MUI_TEXTCOLOR "350052"
!define MUI_WELCOMEFINISHPAGE_BITMAP "..\nsis\brand_side.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH NoStretchNoCrop
!define MUI_INSTFILESPAGE_COLORS "DFB9DE 281831"
!define MUI_INSTFILESPAGE_PROGRESSBAR "colored"
!define MUI_FINISHPAGE_NOAUTOCLOSE
ShowInstDetails show
; Pages --------
!define MUI_WELCOMEPAGE_TITLE "Welcome to the Cwtch installer"
erinn marked this conversation as resolved Outdated
Outdated
Review

we'll have to figure out how to translate these...

we'll have to figure out how to translate these...
Outdated
Review

NSIS has languages and you can I believe tag things with languages... but yeah. that'll be ... a later project as well

NSIS has languages and you can I believe tag things with languages... but yeah. that'll be ... a later project as well
!define MUI_WELCOMEPAGE_TEXT "Cwtch (pronounced: kutch) is a Welsh word roughly meaning 'a hug that creates a safe space'$\n$\n\
Cwtch is a platform for building consentful, decentralized, untrusted infrastructure using metadata resistant group communication applications. Currently there is a selfnamed instant messaging prototype app that is driving development and testing. Many Further apps are planned as the platform matures."
!define MUI_FINISHPAGE_TITLE "Enjoy Cwtch"
!define MUI_FINISHPAGE_RUN $INSTDIR/ui.exe
erinn marked this conversation as resolved Outdated
Outdated
Review

quotes?

quotes?
Outdated
Review

apparently don't need them

apparently don't need them
!define MUI_FINISHPAGE_TEXT "You can keep up-to-date on Cwtch and report any issues you have at https://cwtch.im"
Outdated
Review

nit: up-to-date

nit: up-to-date
Outdated
Review

fixed

fixed
!define MUI_FINISHPAGE_LINK "https://cwtch.im"
!define MUI_FINISHPAGE_LINK_LOCATION "https://cwtch.im"
Outdated
Review

the app itself avoids making clickable links... do we want to apply that policy to the installer as well?

the app itself avoids making clickable links... do we want to apply that policy to the installer as well?
!define MUI_FINISHPAGE_LINK_COLOR "D01972"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "../LICENSE"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Languages --------------------------------
!insertmacro MUI_LANGUAGE "English"
# default section
Section
# define the output path for this file
SetOutPath $INSTDIR
erinn marked this conversation as resolved Outdated
Outdated
Review

quotes?

quotes?
Outdated
Review

doesn't need them

doesn't need them
# define what to install and place it in the output path
# Filler for .sh to populate with contents of deploy/windows
#FILESLISTSTART
FILE /r "windows\"
#FILESLISTEND
# create a shortcut in the start menu programs directory
CreateShortcut "$SMPROGRAMS\Cwtch.lnk" "$INSTDIR\ui.exe"
Outdated
Review

outdated comment?

outdated comment?
Outdated
Review

fixed

fixed
;Store installation folder
WriteRegStr HKCU "Software\Cwtch" "installLocation" $INSTDIR
erinn marked this conversation as resolved Outdated
Outdated
Review

does $INSTDIR potentially need quotes? this ref to ui.exe has quotes but there's one above that does not

does $INSTDIR potentially need quotes? this ref to ui.exe has quotes but there's one above that does not
Outdated
Review

doesn't need it, its in my registry fine

doesn't need it, its in my registry fine
SectionEnd

BIN
nsis/cwtch_title.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
nsis/knot.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB