From fc614e57a573b2b1d0db439b56e19efd66db3a62 Mon Sep 17 00:00:00 2001 From: Rod Christiansen Date: Wed, 7 Oct 2026 22:07:20 -0700 Subject: [PATCH] Remove the unused WiX MSI project build.ps1 builds every package, the MSI included, with cimipkg from build-info.yaml and scripts/, and nothing references build/msi. The WiX project, its Package.wxs and its copy of postinstall.ps1 had drifted from the shipped scripts, so they are deleted along with their .gitignore entry. --- .gitignore | 1 - build/msi/Package.wxs | 168 ------------------ build/msi/StartSet.wixproj | 25 --- build/msi/postinstall.ps1 | 93 ---------- .../Security/DataDirectoryGuard.cs | 2 +- 5 files changed, 1 insertion(+), 288 deletions(-) delete mode 100644 build/msi/Package.wxs delete mode 100644 build/msi/StartSet.wixproj delete mode 100644 build/msi/postinstall.ps1 diff --git a/.gitignore b/.gitignore index 25e24f9..684f204 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ bin/ obj/ release/ -build/msi/obj payload/ # IDE diff --git a/build/msi/Package.wxs b/build/msi/Package.wxs deleted file mode 100644 index 6abcf1b..0000000 --- a/build/msi/Package.wxs +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/msi/StartSet.wixproj b/build/msi/StartSet.wixproj deleted file mode 100644 index 5c40491..0000000 --- a/build/msi/StartSet.wixproj +++ /dev/null @@ -1,25 +0,0 @@ - - - Package - x64 - 7E4F8A2D-3B5C-4D6E-9F1A-2C8D4E5F6A7B - StartSet - Windows Admins Open Source - $(Version) - 1033 - $(Platform) - - - - Debug - bin\$(Platform)\Debug\ - - - - bin\$(Platform)\Release\ - - - - - - diff --git a/build/msi/postinstall.ps1 b/build/msi/postinstall.ps1 deleted file mode 100644 index 8932f8a..0000000 --- a/build/msi/postinstall.ps1 +++ /dev/null @@ -1,93 +0,0 @@ -Start-Transcript -Path "C:\ProgramData\ManagedState\logs\install_log.txt" -Append -# Define paths - matching Paths.cs constants -$startsetDir = "C:\ProgramData\ManagedState" -$installDir = "C:\Program Files\StartSet" - -# Add install directory to system PATH if not already present -Write-Host "Configuring system PATH..." -$currentPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) -if ($currentPath -notlike "*$installDir*") { - $newPath = "$currentPath;$installDir" - [Environment]::SetEnvironmentVariable("PATH", $newPath, [EnvironmentVariableTarget]::Machine) - Write-Host " Added $installDir to system PATH" -} else { - Write-Host " $installDir already in system PATH" -} - -$bootEveryDir = Join-Path $startsetDir "boot-every" -$bootOnceDir = Join-Path $startsetDir "boot-once" -$loginWindowDir = Join-Path $startsetDir "login-window" -$loginPrivilegedEveryDir = Join-Path $startsetDir "login-privileged-every" -$loginPrivilegedOnceDir = Join-Path $startsetDir "login-privileged-once" -$loginEveryDir = Join-Path $startsetDir "login-every" -$loginOnceDir = Join-Path $startsetDir "login-once" -$onDemandDir = Join-Path $startsetDir "on-demand" -$onDemandPrivilegedDir = Join-Path $startsetDir "on-demand-privileged" -$shareDir = Join-Path $startsetDir "share" -$logDir = Join-Path $startsetDir "logs" -# Create directories -$directories = @( - $bootEveryDir, $bootOnceDir, $loginWindowDir, - $loginPrivilegedEveryDir, $loginPrivilegedOnceDir, - $loginEveryDir, $loginOnceDir, $onDemandDir, - $onDemandPrivilegedDir, $shareDir, $logDir -) -foreach ($dir in $directories) { - if (-not (Test-Path -Path $dir)) { - New-Item -Path $dir -ItemType Directory -Force | Out-Null - Write-Host "Created directory: $dir" - } -} -# Define the path to StartSetService.exe (not managedstatekeeper.exe) -$serviceExecutable = Join-Path $installDir "StartSetService.exe" -# Check if StartSetService.exe exists -if (-not (Test-Path -Path $serviceExecutable)) { - Write-Error "StartSetService.exe not found at $serviceExecutable" - exit 1 -} -# Register EventLog source -if (-not [System.Diagnostics.EventLog]::SourceExists("StartSet")) { - New-EventLog -LogName Application -Source "StartSet" - Write-Host "Registered EventLog source: StartSet" -} - -# Define service parameters -$serviceName = "StartSet" -$serviceDisplayName = "StartSet Service" -$serviceDescription = "StartSet - Script automation at boot, login, and on-demand." -# Remove the service if it exists -$existingService = Get-Service -Name $serviceName -ErrorAction SilentlyContinue -if ($existingService) { - try { - if ($existingService.Status -ne 'Stopped') { - Stop-Service -Name $serviceName -Force - Write-Host "Stopped existing service: $serviceName" - } - sc.exe delete $serviceName - Write-Host "Deleted existing service: $serviceName" - } catch { - Write-Error "Failed to remove existing service: $serviceName. $_" - exit 1 - } -} -# Create the service -try { - New-Service -Name $serviceName ` - -BinaryPathName "`"$serviceExecutable`"" ` - -DisplayName $serviceDisplayName ` - -Description $serviceDescription ` - -StartupType Automatic - Write-Host "Created service: $serviceName" -} catch { - Write-Error "Failed to create service: $serviceName. $_" - exit 1 -} -# Start the service -try { - Start-Service -Name $serviceName - Write-Host "Started service: $serviceName" -} catch { - Write-Error "Failed to start service: $serviceName. $_" - exit 1 -} -Stop-Transcript diff --git a/src/Infrastructure/Security/DataDirectoryGuard.cs b/src/Infrastructure/Security/DataDirectoryGuard.cs index 0ee6105..dd62f33 100644 --- a/src/Infrastructure/Security/DataDirectoryGuard.cs +++ b/src/Infrastructure/Security/DataDirectoryGuard.cs @@ -26,7 +26,7 @@ namespace StartSet.Infrastructure.Security; /// run, not something StartSet reads or executes. /// 5. Gives each remaining individually owned file to BUILTIN\Administrators, so no /// account keeps the implicit WRITE_DAC an owner holds. -/// The MSI and the package postinstall set the same ACL when they install. +/// The package postinstall sets the same ACL when it installs. /// [SupportedOSPlatform("windows")] public static class DataDirectoryGuard