Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
[CmdletBinding()]
Param(
  [Parameter(Mandatory=$true)]
  [string]$Packageroot,
  [Parameter(Mandatory=$true)]
  [string]$AppName,
  [Parameter(Mandatory=$true)]
  [string]$AppRelease,
  [Parameter(Mandatory=$true)]
  [string]$LogFile,
  [Parameter(Mandatory=$true)]
  [string]$TempFolder,
  [Parameter(Mandatory=$true)]
  [string]$DllPath,
  [Parameter(Mandatory=$false)]
  [Object]$InputObject=$null
)

try {
    #global variables
    [string]$global:ProductVersion = "1.65.2"
    [string]$global:LogFolder = Split-Path $LogFile -Parent
    [string]$global:InstallFile = "$Packageroot\kit\VSCodeSetup-x64-$global:ProductVersion.exe"
    [string]$global:InstallArgs = "/VERYSILENT /NORESTART /LANG=en /MERGETASKS=!runcode,addcontextmenufiles,addtopath /LOG=`"$(Join-Path $global:LogFolder $AppName).app.log`""

    ##############################################
    #load core PS lib - don't mess with this!
    if ($InputObject){$pgkit=""}else{$pgkit="kit"}
    Import-Module (Join-Path $Packageroot $pgkit "PSlib.psm1") -ErrorAction Stop
    #load Library dll
    $cs=Add-PSDll
    ##############################################

    $cs.Job_Start("WS",$AppName,$AppRelease,$LogFile,"INSTALL")
    $cs.Job_WriteLog("[Init]: Starting package: '" + $AppName + "' Release: '" + $AppRelease + "'")
    if(!$cs.Sys_IsMinimumRequiredDiskspaceAvailable('c:',300)){Exit-PSScript 3333}
    if ($global:DownloadPackage -and $InputObject){Start-PSDownloadPackage}
    
    $retvalue=$cs.Shell_Execute($global:InstallFile,$global:InstallArgs,$true,0,$true)
    if ($retvalue -ne 0){Exit-PSScript $retvalue}
    $cs.Job_WriteLog("Install:","$AppName completed with status: $retvalue")

    Exit-PSScript $Error
}
catch {
    $cs.Job_WriteLog("*****************","Something bad happend: " + $_.Exception.Message)
    Exit-PSScript $_.Exception.HResult
}
  

ScriptingLibrary dll.

Skal placeres i gsWorkstationpath & "Lib\CapaOne.ScriptingLibrary.dll"

Seneste version er 0.2.0.0

View file
nameCapaOne.ScriptingLibrary.dll