[cpp-sp] 02/02: CPPSP-53 Replace Windows Installer with Bat and C program (for registry operations)
Codeberg
noreply at shibboleth.net
Wed Apr 1 18:53:11 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository cpp-sp.
View the commit online:
https://codeberg.org/Shibboleth/cpp-sp/commit/350645ba3c7001de5ef8d755e51aa710e8e811b4
commit 350645ba3c7001de5ef8d755e51aa710e8e811b4
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Apr 1 19:26:48 2026 +0100
CPPSP-53 Replace Windows Installer with Bat and C program (for registry operations)
https://shibboleth.atlassian.net/browse/CPPSP-53
First flush of debugging.
---
Projects/vc22/build.bat | 16 ++++++----------
WindowsInstall/doupdate.bat | 26 +++++++++++++-------------
WindowsInstall/install.bat | 29 ++++++++++++++---------------
WindowsInstall/uninstall.bat | 14 +++++++-------
WindowsInstall/update.bat | 14 +++++++++-----
5 files changed, 49 insertions(+), 50 deletions(-)
diff --git a/Projects/vc22/build.bat b/Projects/vc22/build.bat
index 428343cb..04c9dcb2 100644
--- a/Projects/vc22/build.bat
+++ b/Projects/vc22/build.bat
@@ -14,19 +14,15 @@ rem Clean
del /s *.obj *.lib *.dll *.exe
del /s *.obj *.lib *.dll *.exe
-if exist kit.zip (
- del kit.zip
-)
+if exist kit.zip del kit.zip
-if exist kit {
- rd /s /q kit
-}
+if exist kit rd /s /q kit
REM Build all the DLLS and the msiversion executable
REM everything for x64
-msbuild -m /property:Platform=x64;Configuration=release /MaxCPUCount Shibboleth.sln /t:iis;NativeLogMessages;MsiVersion;Apache
+msbuild -m /property:Platform=x64;Configuration=release /MaxCPUCount Shibboleth.sln /t:iis;NativeLogMessages;Version;Apache
REM IIS only for Arm64 and x86
msbuild -m /property:Platform=arm64;Configuration=release /MaxCPUCount Shibboleth.sln /t:iis
@@ -43,7 +39,6 @@ echo 1 > kit\dist\InstallerVersion.txt
mkdir kit\dist\bin
copy ..\..\WindowsInstall\update.bat kit\dist\bin\
-copy ..\..\WindowsInstall\uninstall.bat kit\dist\bin\
copy ..\..\WindowsInstall\setacl.bat kit\dist\bin\
@@ -62,7 +57,8 @@ copy ..\..\configs\request-map.xml kit\dist\etc
copy ..\..\WindowsInstall\shib.ico kit\dist
mkdir kit\dist\dist-bin\
-copy ..\..\WindowsInstall\doupdate.bat kit\dist-bin\bin\
-copy ..\..\WindowsInstall\regkeys.txt kit\dist-bin\bin\
+copy ..\..\WindowsInstall\doupdate.bat kit\dist\dist-bin\
+copy ..\..\WindowsInstall\regkeys.txt kit\dist\dist-bin\
+copy ..\..\WindowsInstall\uninstall.bat kit\dist\dist-bin\
tar -a -c -f kit.zip kit
diff --git a/WindowsInstall/doupdate.bat b/WindowsInstall/doupdate.bat
index ba18aa86..865d17e4 100644
--- a/WindowsInstall/doupdate.bat
+++ b/WindowsInstall/doupdate.bat
@@ -1,9 +1,9 @@
- at echo off
+rem @echo off
REM Update SP agent
setlocal
-rem Find FQP forK target and root of installation
+rem Find FQP for target and root of installation
set SAVE_WORKING_DIR=%cd%
cd %1%
set TargetDir=%cd%
@@ -18,7 +18,7 @@ Set /a MinorVersion="(%VERSION% >> 16) & 0xFF" > nul:
Set /a PatchVersion = "%VERSION% & 0xFFFF" > nul:
set VersionString=%MajorVersion%.%MinorVersion%.%PatchVersion%
-if (exist %TargetDir%\lib\shibboleth-sp) (
+if exist %TargetDir%\lib\shibboleth-sp (
Echo Updating SP Agent Version %VersionString%
) else (
Echo Installing SP Agent Version %VersionString%
@@ -26,26 +26,30 @@ if (exist %TargetDir%\lib\shibboleth-sp) (
rem
rem use robocopy to copy stuff over
+rem /s recursive
rem /is copy eveything
rem /njh No job header
rem /njs No job summary
-
echo Copying Distribution to %targetDir%\dist-%VersionString%
-robocopy /is /njs /njh . %targetDir%\dist-%VersionString%\
+mkdir "%targetDir%\dist-%VersionString%"
+robocopy /s /is /njs /njh . "%targetDir%\dist-%VersionString%"
echo Copying Batch Files to %targetdir%\bin\shibboleth-sp\
-robocopy /is /njs /njh bin "%targetdir%\bin\shibboleth-sp\"
+mkdir "%targetdir%\bin\shibboleth-sp\"
+robocopy /is /njs /njh bin "%targetdir%\bin\shibboleth-sp"
echo Copying Dll Files to %targetdir%\lib\shibboleth-sp\
-robocopy /is /njs /njh lib "%targetdir%\lib\shibboleth-sp\"
+mkdir "%targetdir%\lib\shibboleth-sp\"
+robocopy /is /njs /njh lib "%targetdir%\lib\shibboleth-sp"
-echo Coping new config Files
rem /xc /xn /xo only new files
rem /xc exclude existing files same timestamp different sizes
rem /xn exclude newer
rem /xo exclude older
rem Hence /xo /xc /xn means "copy every file where a file of that name isn't there"
-robocopy /xc /xn /xo /njs /njh etc "%targetdir%\etc\shibboleth-sp\"
+echo Copying new config Files
+mkdir "%targetdir%\etc\shibboleth-sp\"
+robocopy /xc /xn /xo /njs /njh etc "%targetdir%\etc\shibboleth-sp"
rem Set registry
echo "just add code to update registry"
@@ -67,7 +71,3 @@ reg by hand
reg file called regkeys.txt
-
-:exit
-cd /d %SAVE_WORKING_DIR%
-exit /b
diff --git a/WindowsInstall/install.bat b/WindowsInstall/install.bat
index 49dcdfd2..040ee31f 100644
--- a/WindowsInstall/install.bat
+++ b/WindowsInstall/install.bat
@@ -1,4 +1,4 @@
- at echo off
+rem @echo off
REM Install SP agent
setlocal
@@ -11,40 +11,39 @@ set SOURCE_DIR=%cd%
rem - Collect targetDir [opt\shibboleth-sp]
set loc=%SystemDrive%\opt\shibboleth-sp
set /p TargetDir="Location To Install [%loc%] :"
-if "%TargetDir%" == "" ( set TargetDir=%loc%
+if "%TargetDir%" == "" set TargetDir=%loc%
rem - Fail if lib or bin exist
-if exist %TargetDir%\bin\shibboleth-sp (
+if exist "%TargetDir%\bin\shibboleth-sp" (
echo %TargetDir%\bin\shibboleth-sp exists. Agent may already be installed
- echo Did you bean %TargetDir%\bin\shibboleth-sp\update ?
+ echo Did you mean %TargetDir%\bin\shibboleth-sp\update ?
exit /b
)
-if exist %TargetDir%\lib\shibboleth-sp (
+if exist "%TargetDir%\lib\shibboleth-sp" (
echo %TargetDir%\lib\shibboleth-sp exists. Agent may already be installed
- echo Did you bean %TargetDir%\bin\shibboleth-sp\update ?
+ echo Did you mean %TargetDir%\bin\shibboleth-sp\update ?
exit /b
)
Rem Call generic "install/update" bar file shipped with this release
-dist-bin\doupdate.bat "%targetDir%"
+mkdir "%targetDir%"
+cmd /c dist\dist-bin\doupdate.bat "%targetDir%"
+
+Rem TODOODOTODO nativelogmessage into registry
Rem Detect IIS and configure if there
-if exist %SYSTEMROOT%\INETSRV\appcmd.exe (
+if exist %SYSTEMROOT%\System32\INETSRV\appcmd.exe (
echo Installing ShibAgent module into IIS
- %SYSTEMROOT%\INETSRV\appcmd.exe install module /name:ShibAgent /image:"%TargetDir%\lib\shibboleth-sp\iis_shib4.dll"
+ %SYSTEMROOT%\System32\INETSRV\appcmd.exe install module /name:ShibAgent /image:"%TargetDir%\lib\shibboleth-sp\iis_shib4.dll"
)
Rem Aak to update ACLs and if so CALL SETACL
:loop
set /p YesNo="Run SetAcl.bat [Yn] "
-if /i "%YesNo%"=="n" goto exit
+if /i "%YesNo%"=="n" exit /b
if /i not "%YesNo%"=="y" goto loop
-%TargetDir%\bin\shibboleth-sp\setacl.bat
-
-:exit
-cd /d %SAVE_WORKING_DIR%
-exit /b
+cmd/c %TargetDir%\bin\shibboleth-sp\setacl.bat
diff --git a/WindowsInstall/uninstall.bat b/WindowsInstall/uninstall.bat
index b0d0c583..4307f774 100644
--- a/WindowsInstall/uninstall.bat
+++ b/WindowsInstall/uninstall.bat
@@ -6,19 +6,19 @@ REM
Rem Goto root of install - we are running from %targetDir%\dist-4.x.7\dist-bin\
cd %dp0..\.
-if exist %SYSTEMROOT%\INETSRV\appcmd.exe (
+if exist %SYSTEMROOT%\System32\INETSRV\appcmd.exe (
echo Uninstalling ShibAgent module from IIS
- %SYSTEMROOT%\INETSRV\appcmd.exe delete module ShibAgent
- %SYSTEMROOT%\INETSRV\appcmd.exe uninstall module ShibAgent
+ %SYSTEMROOT%\System32\INETSRV\appcmd.exe delete module ShibAgent
+ %SYSTEMROOT%\System32\INETSRV\appcmd.exe uninstall module ShibAgent
)
set base=%cd%
echo Removing %base%\bin\shibboleth-sp\
-rd /s /q "%base%\bin\shibboleth-sp\"
+rd /s /q "%base%\bin\shibboleth-sp"
echo Removing %base%\lib\shibboleth-sp\
-rd /s /q "%base%\lib\shibboleth-sp\"
+rd /s /q "%base%\lib\shibboleth-sp"
-Echo not touching %base%\etc\shibboleth-sp\
+echo Not touching %base%\etc\shibboleth-sp\
-echo "just add code to remove [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D9DA52E3-F96E-4C84-B153-C3B17C34F730}]"
+echo "just add code to remove [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D9DA52E3-F96E-4C84-B153-C3B17C34F730}]" and reg keys
diff --git a/WindowsInstall/update.bat b/WindowsInstall/update.bat
index cd49465b..033efd0d 100644
--- a/WindowsInstall/update.bat
+++ b/WindowsInstall/update.bat
@@ -1,14 +1,18 @@
+rem @echo off
+
setlocal
rem fail if parameters is not a distribution
-if (not exist %1%\dist-bin\doupdate.bat) (
- echo "%1% is not a Shibboleth agent distribution
+if not exist "%1%\dist\dist-bin\doupdate.bat" (
+ echo "%1% is not a Shibboleth agent distribution"
exit /b
)
rem find root of install
-cd %dp0..
-set path=%cd%
+cd %~dp0..
+set install_path=%cd%
+
+cd "%1%\dist\dist-bin\"
+cmd /c doupdate.bat "%install_path%"
-"%1%\dist-bin\doupdate.bat" "%path%"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list