installer/windows: batch file improvements (#3441)
This commit is contained in:
parent
0cc7056a9a
commit
325790703f
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -85,7 +85,7 @@ node('node') {
|
|||||||
|
|
||||||
unstash "storagenode-binaries"
|
unstash "storagenode-binaries"
|
||||||
|
|
||||||
bat 'installer\\windows\\build.bat'
|
bat 'installer\\windows\\buildrelease.bat'
|
||||||
|
|
||||||
stash name: "storagenode-installer", includes: "release/**/storagenode*.msi"
|
stash name: "storagenode-installer", includes: "release/**/storagenode*.msi"
|
||||||
|
|
||||||
|
1
installer/windows/.gitignore
vendored
1
installer/windows/.gitignore
vendored
@ -4,6 +4,7 @@
|
|||||||
/obj/
|
/obj/
|
||||||
*/obj/
|
*/obj/
|
||||||
/packages/
|
/packages/
|
||||||
|
|
||||||
*.exe
|
*.exe
|
||||||
*.msi
|
*.msi
|
||||||
*.wixobj
|
*.wixobj
|
||||||
|
@ -1,9 +1,17 @@
|
|||||||
rem set the TAG env var from the release dir
|
@echo off
|
||||||
for /f %%i in ('dir /B release') do set TAG=%%i
|
|
||||||
|
rem count # of args
|
||||||
|
set argC=0
|
||||||
|
for %%x in (%*) do Set /A argC+=1
|
||||||
|
|
||||||
|
if not "%argC%"=="3" (
|
||||||
|
echo usage: %~nx0 ^<storagenode.exe input path^> ^<storagenode-updater.exe input path^> ^<msi output path^>
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
|
||||||
rem copy the storagenode binaries to the installer project
|
rem copy the storagenode binaries to the installer project
|
||||||
copy release\%TAG%\storagenode_windows_amd64.exe installer\windows\storagenode.exe
|
copy %1 installer\windows\storagenode.exe
|
||||||
copy release\%TAG%\storagenode-updater_windows_amd64.exe installer\windows\storagenode-updater.exe
|
copy %2 installer\windows\storagenode-updater.exe
|
||||||
|
|
||||||
rem install NuGet packages
|
rem install NuGet packages
|
||||||
nuget install installer\windows\StorjTests\packages.config -o installer\windows\packages
|
nuget install installer\windows\StorjTests\packages.config -o installer\windows\packages
|
||||||
@ -11,5 +19,9 @@ nuget install installer\windows\StorjTests\packages.config -o installer\windows\
|
|||||||
rem build the installer
|
rem build the installer
|
||||||
msbuild installer\windows\windows.sln /t:Build /p:Configuration=Release
|
msbuild installer\windows\windows.sln /t:Build /p:Configuration=Release
|
||||||
|
|
||||||
|
rem cleanup copied binaries
|
||||||
|
del installer\windows\storagenode.exe
|
||||||
|
del installer\windows\storagenode-updater.exe
|
||||||
|
|
||||||
rem copy the MSI to the release dir
|
rem copy the MSI to the release dir
|
||||||
copy installer\windows\bin\Release\storagenode.msi release\%TAG%\storagenode_windows_amd64.msi
|
copy installer\windows\bin\Release\storagenode.msi %3
|
||||||
|
6
installer/windows/buildrelease.bat
Normal file
6
installer/windows/buildrelease.bat
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem build msi installer for each release directory
|
||||||
|
for /d %%d in (release\*) do (
|
||||||
|
call %~dp0build.bat %%d\storagenode_windows_amd64.exe %%d\storagenode-updater_windows_amd64.exe %%d\storagenode_windows_amd64.msi
|
||||||
|
)
|
30
installer/windows/install.bat
Normal file
30
installer/windows/install.bat
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
|
rem NB: This script requires administrative privileges.
|
||||||
|
rem It can't prompt for escalation if the `/q` option is used.
|
||||||
|
|
||||||
|
rem count # of args
|
||||||
|
set argC=0
|
||||||
|
for %%x in (%*) do Set /A argC+=1
|
||||||
|
|
||||||
|
if not %argC% gtr 0 (
|
||||||
|
echo usage: %~nx0 ^[\q^] "<msi path (using '\' separators)>" ^[PROPERTY="value" ...^]
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set interactivity=/passive /qb
|
||||||
|
if not %1==/q set msipath=%1
|
||||||
|
if %1==/q set msipath=%2
|
||||||
|
set props=STORJ_WALLET="0x0000000000000000000000000000000000000000" STORJ_EMAIL="user@mail.example" STORJ_PUBLIC_ADDRESS="127.0.0.1:10000"
|
||||||
|
for %%x in (%*) do (
|
||||||
|
if not %%x==%msipath% if not %%x==/q set props=!props! %%x
|
||||||
|
if %%x==/q set interactivity=/quiet /qn
|
||||||
|
)
|
||||||
|
|
||||||
|
rem uninstall existing storagenode product
|
||||||
|
echo uninstalling storagenode
|
||||||
|
call %~dp0uninstall.bat %msipath%
|
||||||
|
|
||||||
|
echo installing storagenode from %msipath%
|
||||||
|
msiexec /i %msipath% %interactivity% /norestart /log %~dp1install.log %props%
|
7
installer/windows/installrelease.bat
Normal file
7
installer/windows/installrelease.bat
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem NB: only installs from *first* release directory
|
||||||
|
for /d %%d in (release\*) do (
|
||||||
|
call %~dp0install.bat %%d\storagenode_windows_amd64.msi
|
||||||
|
goto :EOF
|
||||||
|
)
|
14
installer/windows/uninstall.bat
Normal file
14
installer/windows/uninstall.bat
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem count # of args
|
||||||
|
set argC=0
|
||||||
|
for %%x in (%*) do Set /A argC+=1
|
||||||
|
|
||||||
|
if not %argC%==1 (
|
||||||
|
echo usage: %~nx0 "<msi path (using '\' separators)>"
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set msipath=%1
|
||||||
|
msiexec /uninstall %msipath%
|
Loading…
Reference in New Issue
Block a user