Add scripts to installer, clean msi files

This commit is contained in:
twangboy 2023-06-05 16:49:18 -06:00 committed by Megan Wilhite
parent 2f07a4e3af
commit 7a802fbb6e
4 changed files with 52 additions and 3 deletions

View file

@ -140,6 +140,33 @@ if ( Test-Path -Path "$RELENV_DIR" ) {
}
}
#-------------------------------------------------------------------------------
# Remove MSI build files
#-------------------------------------------------------------------------------
$files = @(
"msi/CustomAction01/CustomAction01.CA.dll",
"msi/CustomAction01/CustomAction01.dll",
"msi/CustomAction01/CustomAction01.pdb",
"msi/Product-discovered-files-config.wixobj",
"msi/Product-discovered-files-config.wxs",
"msi/Product-discovered-files-x64.wixobj",
"msi/Product-discovered-files-x64.wxs",
"msi/Product.wixobj"
)
$files | ForEach-Object {
if ( Test-Path -Path "$SCRIPT_DIR\$_" ) {
# Use .net, the powershell function is asynchronous
Write-Host "Removing $_`: " -NoNewline
[System.IO.File]::Delete("$SCRIPT_DIR\$_")
if ( ! (Test-Path -Path "$SCRIPT_DIR\$_") ) {
Write-Result "Success" -ForegroundColor Green
} else {
Write-Result "Failed" -ForegroundColor Red
exit 1
}
}
}
#-------------------------------------------------------------------------------
# Script Completed
#-------------------------------------------------------------------------------

View file

@ -1,3 +1,5 @@
:: This is a helper script for multi-minion.ps1.
:: See multi-minion.ps1 for documentation
@ echo off
Set "CurDir=%~dp0"
PowerShell -ExecutionPolicy RemoteSigned -File "%CurDir%\multi-minion.ps1" %*

View file

@ -4,11 +4,11 @@ Script for setting up an additional salt-minion on a machine with Salt installed
.DESCRIPTION
This script will install an additional minion on a machine that already has a
Salt installtion using one of the Salt packages. It will set up the directory
Salt installation using one of the Salt packages. It will set up the directory
structure required by Salt. It will also lay down a minion config to be used
by the Salt minion. Additionaly, this script will install and start a Salt
minion service that uses the root_dir and minion config. You can also pass the
name of a service account to be used by the service.
minion service that uses the root_dir specified in the minion config. You can
also pass the name of a service account to be used by the service.
You can also remove the multiminion setup with this script.

View file

@ -165,6 +165,25 @@ if ( ! (Test-Path -Path "$BUILD_DIR\ssm.exe") ) {
}
}
# Copy the multiminion scripts to the Build directory
$scripts = @(
"multi-minion.cmd",
"multi-minion.ps1"
)
$scripts | ForEach-Object {
if (!(Test-Path -Path "$BUILD_DIR\$_")) {
Write-Host "Copying $_ to the Build directory: " -NoNewline
Copy-Item -Path "$SCRIPT_DIR\$_" -Destination "$BUILD_DIR\$_"
if (Test-Path -Path "$BUILD_DIR\$_") {
Write-Result "Success" -ForegroundColor Green
} else {
Write-Result "Failed" -ForegroundColor Red
exit 1
}
}
}
# Copy VCRedist 2013 to the prereqs directory
New-Item -Path $PREREQ_DIR -ItemType Directory | Out-Null
Write-Host "Copying VCRedist 2013 $ARCH_X to prereqs: " -NoNewline
$file = "vcredist_$ARCH_X`_2013.exe"
@ -176,6 +195,7 @@ if ( Test-Path -Path "$PREREQ_DIR\$file" ) {
exit 1
}
# Copy Universal C Runtimes to the prereqs directory
Write-Host "Copying Universal C Runtimes $ARCH_X to prereqs: " -NoNewline
$file = "ucrt_$ARCH_X.zip"
Invoke-WebRequest -Uri "$SALT_DEP_URL/$file" -OutFile "$PREREQ_DIR\$file"