Skip to content

feat: add windows amd64 installer #4719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: PR comments
  • Loading branch information
deansheather committed Oct 25, 2022
commit 46d855ec0034c67d35d1bfbf8ed550e5bfc5c82a
10 changes: 6 additions & 4 deletions scripts/build_windows_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ if [[ ! -f "$1" ]]; then
fi
input_file="$(realpath "$1")"

# Remove the "v" prefix and ensure the version is in the format X.X.X.X for
# makensis.
version="${version#v}"
if [[ "$version" == "" ]]; then
version="$(execrelative ./version.sh)"
fi
version="${version//-*/}"
version+=".$(date -u +%Y%m%d%H%M)"

# Remove the "v" prefix and ensure the version is in the format X.X.X.X for
# makensis.
nsis_version="${version//-*/}"
nsis_version+=".$(date -u +%Y%m%d%H%M)"

# Check dependencies
dependencies makensis
Expand Down Expand Up @@ -113,6 +114,7 @@ pushd "$temp_dir"
makensis \
-V4 \
-DCODER_VERSION="$version" \
-DCODER_NSIS_VERSION="$nsis_version" \
-DCODER_YEAR="$(date +%Y)" \
installer.nsi
popd
Expand Down
8 changes: 5 additions & 3 deletions scripts/win-installer/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Unicode true

!define APP_NAME "Coder"
!define COMP_NAME "Coder Technologies, Inc."
!define VERSION "${CODER_VERSION}"
!define VERSION "${CODER_NSIS_VERSION}"
!define COPYRIGHT "Copyright (c) ${CODER_YEAR} Coder Technologies, Inc."
!define DESCRIPTION "Remote development environments on your infrastructure provisioned with Terraform"
!define INSTALLER_NAME "installer.exe"
Expand Down Expand Up @@ -37,7 +37,7 @@ SetCompressor /SOLID Lzma
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
BrandingText "${APP_NAME} v${CODER_VERSION}"
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" "Path"
InstallDir "${INSTALL_DIR}"

Expand All @@ -55,6 +55,8 @@ InstallDir "${INSTALL_DIR}"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING

!define MUI_WELCOMEPAGE_TEXT "Setup will guide you through the installation of Coder v${CODER_VERSION}.$\r$\n$\r$\nClick Next to continue."

!insertmacro MUI_PAGE_WELCOME

!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
Expand All @@ -65,7 +67,7 @@ InstallDir "${INSTALL_DIR}"

!insertmacro MUI_PAGE_INSTFILES

!define MUI_FINISHPAGE_TEXT "Coder has been installed on your computer.$\r$\n$\r$\nTo use Coder, sign out and back in, then open a command prompt or PowerShell and run `coder`.$\r$\n$\r$\nClick Finish to close Setup."
!define MUI_FINISHPAGE_TEXT "Coder v${CODER_VERSION} has been installed on your computer.$\r$\n$\r$\nIf you added Coder to your PATH, you can use Coder by opening a command prompt or PowerShell and running `coder`. You may have to sign out and sign back in for `coder` to be available.$\r$\n$\r$\nClick Finish to close Setup."

!insertmacro MUI_PAGE_FINISH

Expand Down
8 changes: 8 additions & 0 deletions scripts/win-installer/path.nsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# PATH utilities. Taken from:
# https://www.smartmontools.org/browser/trunk/smartmontools/os_win32/installer.nsi?rev=5310#L689

; os_win32/installer.nsi - smartmontools install NSIS script
;
; Home page of code is: https://www.smartmontools.org
;
; Copyright (C) 2006-22 Christian Franke
;
; SPDX-License-Identifier: GPL-2.0-or-later


;--------------------------------------------------------------------
; Path functions
Expand Down