BUGFIX client windows

This commit is contained in:
2020-07-10 13:55:06 +02:00
parent 98dfc03695
commit 85892918df
3 changed files with 16 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
# Build 15. Using API 2
# Build 17. Using API 2
param([Int32]$startup=0)
#Write-Host $startup
$srcdir = $PSCommandPath | Split-Path -Parent
@@ -189,7 +189,7 @@ foreach ($CookName in $cooks){
"REMOVE" { # Remove files / folders
Remove-Item "$param" -Recurse -Force -ErrorAction Continue # They not see errors (Because error will be file not found)
}
"INSTALLMSI" { # Installs a .msi file (From $env:temp)
{$_ -in "INSTALLMSI","MSIINSTALL"} { # Installs a .msi file (From $env:temp)
Start-Process msiexec.exe -Wait -ArgumentList "/norestart /quiet /I $param" -ErrorVariable errvar
if ($? -eq $false){ # Error in MSI
$err = 1
@@ -214,6 +214,16 @@ foreach ($CookName in $cooks){
"ENDNOERROR" {
$noerror = 0
}
"IFCOMPUTERNAME" { # If Computer Name is something
$inif = $true #This controls IF start/stop
$cname = (Get-ComputerName).CSName
if ($cname -eq "$param"){
$if = $True
}else{
$if = $False
}
# True -> Exists ; False -> Not exists
}
"IFSOFTWAREINST" { # If with software
$inif = $true #This controls IF start/stop
Get-Package -Name "$param*" -ErrorAction SilentlyContinue #This will return error if program is not installed, do not see it.