Skip to content

Commit

Permalink
Use EnVar plugin instead of EnvVarUpdate.nsh
Browse files Browse the repository at this point in the history
  • Loading branch information
nabijaczleweli committed Mar 11, 2020
1 parent eddd4d9 commit 18273e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ install:
- set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%;C:\Users\appveyor\.cargo\bin
- bash -lc "pacman --needed --noconfirm -Sy pacman-mirrors"
- bash -lc "pacman --noconfirm -Sy"
- bash -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-nsis"
- bash -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-nsis unzip"
-
- curl -SL https://win.rustup.rs/ -oC:\rustup-init.exe
- C:\rustup-init.exe -y --default-host="x86_64-pc-windows-gnu"
-
- curl -SOL https://cdn.rawgit.com/nabijaczleweli/880a4b42368c610dc5de041d73bbea58/raw/d84dfb47245c7c44af34940d957c17099dc38c2b/EnvVarUpdate.nsh
- curl -SOL https://cdn.rawgit.com/nabijaczleweli/880a4b42368c610dc5de041d73bbea58/raw/7f3a23efe680d06934e6c0d7c9fbe92216da0682/EnVar_plugin.zip
- unzip -j EnVar_plugin.zip Plugins/amd64-unicode/EnVar.dll -d C:\msys64\mingw64\share\nsis\Plugins\unicode

build: off
build_script:
- git submodule update --init --recursive
- cargo build --verbose --release
- cp target\release\http.exe http-v1.9.0.exe
- strip --strip-all --remove-section=.comment --remove-section=.note http-v1.9.0.exe
- makensis -DHTTP_VERSION=v1.9.0 "/X!include \"EnvVarUpdate.nsh\"" install.nsi
- makensis -DHTTP_VERSION=v1.9.0 install.nsi

test: off
test_script:
Expand Down
11 changes: 9 additions & 2 deletions install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ Section
SectionEnd

Section "Update PATH"
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$PROGRAMFILES\http"
EnVar::SetHKLM
EnVar::AddValue "PATH" "$PROGRAMFILES\http"
Pop $0
DetailPrint "Adding $PROGRAMFILES\http to %PATH%: $0"
SectionEnd

Section "Uninstall"
Delete "$INSTDIR\uninstall http ${HTTP_VERSION}.exe"
Delete "$INSTDIR\http.exe"
Delete "$INSTDIR"
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$PROGRAMFILES\http"

EnVar::SetHKLM
EnVar::DeleteValue "PATH" "$PROGRAMFILES\http"
Pop $0
DetailPrint "deleting $PROGRAMFILES\http from %PATH%: $0"
SectionEnd

0 comments on commit 18273e4

Please sign in to comment.