Skip to content

Commit

Permalink
Updated build process. Added code signing and MD5 checksums for distr…
Browse files Browse the repository at this point in the history
…o files.
  • Loading branch information
coreybutler committed Aug 8, 2018
1 parent 256d694 commit 438ac25
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ If this is an issue regarding antivirus, make sure you search the existing issue

### I'm using NVM4W version:

- [ ] 1.1.7
- [ ] 1.1.6
- [ ] 1.1.5
- [ ] 1.1.4
Expand Down Expand Up @@ -54,4 +55,3 @@ Fill me in...
### Steps to reproduce the problem:

Fill me in...

52 changes: 21 additions & 31 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,48 @@ REM SET GOPATH=%CD%\src
SET GOBIN=%CD%\bin
SET GOARCH=386
SET version=1.1.7

REM Get the version number from the setup file
REM for /f "tokens=*" %%i in ('findstr /n . %INNOSETUP% ^| findstr ^4:#define') do set L=%%i
REM set version=%L:~24,-1%

REM Get the version number from the core executable
REM for /f "tokens=*" %%i in ('findstr /n . %GOPATH%\nvm.go ^| findstr ^NvmVersion^| findstr ^21^') do set L=%%i
REM set goversion=%L:~19,-1%

REM IF NOT %version%==%goversion% GOTO VERSIONMISMATCH

SET DIST=%CD%\dist\%version%

REM Build the executable
echo Building NVM for Windows
REM rm %GOBIN%\nvm.exe
REM cd %GOPATH%
echo "=========================================>"
REM echo %GOBIN%
REM goxc -arch="386" -os="windows" -n="nvm" -d="%GOBIN%" -o="%GOBIN%\nvm{{.Ext}}" -tasks-=package

REM cd %ORIG%
REM rm %GOBIN%\src.exe
REM rm %GOPATH%\src.exe
REM rm %GOPATH%\nvm.exe

REM Clean the dist directory
rm -rf "%DIST%"
echo Remove existing build at %DIST%
rd /s /q "%DIST%"
echo Creating %DIST%
mkdir "%DIST%"

echo Creating distribution in %DIST%

if exist src\nvm.exe (
rm src\nvm.exe
del src\nvm.exe
)

echo "Building nvm.exe...."
echo Building nvm.exe:

go build src\nvm.go
mv nvm.exe %GOBIN%
move nvm.exe %GOBIN%
for /f %%i in ('%GOBIN%\nvm.exe version') do set BUILT_VERSION=%%i

if NOT %BUILT_VERSION% == %version% (
echo Expected nvm.exe version %version% but created version %BUILT_VERSION%
exit 1
) else (
echo nvm.exe v%BUILT_VERSION% built.
)

echo Code Sign nvm.exe...
.\buildtools\signtools\x64\signtool.exe sign /debug /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a %GOBIN%\nvm.exe

echo Building "noinstall" zip...
for /d %%a in (%GOBIN%) do (buildtools\zip -j -9 -r "%DIST%\nvm-noinstall.zip" "%CD%\LICENSE" "%%a\*" -x "%GOBIN%\nodejs.ico")
for /f %%a in (%GOBIN%) do (buildtools\zip -j -9 -r "%DIST%\nvm-noinstall.zip" "%CD%\LICENSE" "%%a\*" -x "%GOBIN%\nodejs.ico")

echo "Building the primary installer..."
buildtools\iscc %INNOSETUP% /o%DIST%
buildtools\zip -j -9 -r "%DIST%\nvm-setup.zip" "%DIST%\nvm-setup.exe"

echo "Generating Checksums for release files..."
for %%f in (%DIST%\*.*) do (certutil -hashfile "%%f" MD5 | find /i /v "md5" | find /i /v "certutil" >> "%%f.checksum.txt")

for /r %i in (*.zip *.exe) do checksum -file %i -t sha256 >> %i.sha256.txt
echo "Distribution created. Now cleaning up...."
rm %GOBIN%/nvm.exe
del %GOBIN%\nvm.exe

echo "Done."
@echo on
8 changes: 4 additions & 4 deletions buildtools/Default.isl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ InstallingLabel=Please wait while Setup installs [name] on your computer.
; *** "Setup Completed" wizard page
FinishedHeadingLabel=Completing the [name] Setup Wizard
FinishedLabelNoIcons=Setup has finished installing [name] on your computer.
FinishedLabel=Setup has finished installing [name] on your computer. The application may be launched by selecting the installed icons.
FinishedLabel=Setup has finished installing [name] on your computer. The application may be launched by selecting the installed shortcuts.
ClickFinish=Click Finish to exit Setup.
FinishedRestartLabel=To complete the installation of [name], Setup must restart your computer. Would you like to restart now?
FinishedRestartMessage=To complete the installation of [name], Setup must restart your computer.%n%nWould you like to restart now?
Expand Down Expand Up @@ -323,9 +323,9 @@ ShutdownBlockReasonUninstallingApp=Uninstalling %1.
[CustomMessages]

NameAndVersion=%1 version %2
AdditionalIcons=Additional icons:
CreateDesktopIcon=Create a &desktop icon
CreateQuickLaunchIcon=Create a &Quick Launch icon
AdditionalIcons=Additional shortcuts:
CreateDesktopIcon=Create a &desktop shortcut
CreateQuickLaunchIcon=Create a &Quick Launch shortcut
ProgramOnTheWeb=%1 on the Web
UninstallProgram=Uninstall %1
LaunchProgram=Launch %1
Expand Down
Binary file modified buildtools/ISCmplr.dll
Binary file not shown.
Binary file modified buildtools/ISPP.dll
Binary file not shown.
Loading

0 comments on commit 438ac25

Please sign in to comment.