Improve custom desktop location support
This commit is contained in:
parent
06c34b7966
commit
1b5eb3fa66
|
@ -1,7 +1,9 @@
|
||||||
# Install ConceptDeploy module for current user
|
# Install ConceptDeploy module for current user
|
||||||
Set-Variable -Name MODULE_NAME -Value 'ConceptDeploy' -Option Constant
|
|
||||||
|
|
||||||
$modulePath = "$env:USERPROFILE\Documents\WindowsPowerShell\modules\$MODULE_NAME"
|
Set-Variable -Name MODULE_NAME -Value 'ConceptDeploy' -Option Constant
|
||||||
|
$localHome = 'C:\Tools'
|
||||||
|
|
||||||
|
$modulePath = "${localHome}\$MODULE_NAME"
|
||||||
if (Test-Path -Path $modulePath) {
|
if (Test-Path -Path $modulePath) {
|
||||||
Remove-Item $modulePath -Recurse -Force
|
Remove-Item $modulePath -Recurse -Force
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
# Deploy ConceptDeploy module files to server storage
|
# Deploy ConceptDeploy module files to server storage
|
||||||
Set-StrictMode -Version 3.0
|
Set-StrictMode -Version 3.0
|
||||||
Set-Variable -Name MODULE_NAME -Value 'ConceptDeploy'
|
Set-Variable -Name MODULE_NAME -Value 'ConceptDeploy'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Install Concept products from local distr
|
# Install Concept products from local distr
|
||||||
|
|
||||||
# Setup constants
|
# Setup constants
|
||||||
Set-Variable -Name OFFICE_REGISTRY -Value 'HKCU:\SOFTWARE\Microsoft\Office\16.0' -Option Constant
|
Set-Variable -Name OFFICE_REGISTRY -Value 'HKCU:\SOFTWARE\Microsoft\Office\16.0' -Option Constant
|
||||||
|
@ -11,6 +11,10 @@ $word = If (Test-Path "${OFFICE_REGISTRY}\Word") {"${OFFICE_REGISTRY}\Word"} Els
|
||||||
$excel = If (Test-Path "${OFFICE_REGISTRY}\Excel") {"${OFFICE_REGISTRY}\Excel"} Else {''}
|
$excel = If (Test-Path "${OFFICE_REGISTRY}\Excel") {"${OFFICE_REGISTRY}\Excel"} Else {''}
|
||||||
$visio = If (Test-Path "${OFFICE_REGISTRY}\Visio") {"${OFFICE_REGISTRY}\Visio"} Else {''}
|
$visio = If (Test-Path "${OFFICE_REGISTRY}\Visio") {"${OFFICE_REGISTRY}\Visio"} Else {''}
|
||||||
|
|
||||||
|
$desktopPath = [Environment]::GetFolderPath('Desktop')
|
||||||
|
$localHome = 'C:\Tools'
|
||||||
|
$Env:PSModulePath += ";${localHome}"
|
||||||
|
|
||||||
function InstallAllProducts {
|
function InstallAllProducts {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param(
|
Param(
|
||||||
|
@ -22,8 +26,8 @@ function InstallAllProducts {
|
||||||
|
|
||||||
Set-StrictMode -Version 3.0
|
Set-StrictMode -Version 3.0
|
||||||
|
|
||||||
if (-not (Test-Path -Path $distrPath)) {
|
if (-not (Test-Path -Path ${distrPath})) {
|
||||||
Write-Error "Distribution path does not exist: $distrPath"
|
Write-Error "Distribution path does not exist: ${distrPath}"
|
||||||
Exit 1
|
Exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,29 +36,28 @@ function InstallAllProducts {
|
||||||
StartLog
|
StartLog
|
||||||
|
|
||||||
Write-Host "Starting installation procedure for Concept technologies" -ForegroundColor DarkGreen
|
Write-Host "Starting installation procedure for Concept technologies" -ForegroundColor DarkGreen
|
||||||
Write-Host "Sources: $distrPath"
|
Write-Host "Sources: ${distrPath}"
|
||||||
Write-Host "Skip shortcuts: $skipShortcuts`n"
|
Write-Host "Skip shortcuts: ${skipShortcuts}`n"
|
||||||
|
|
||||||
Write-Host "Dependencies status:" -ForegroundColor DarkGreen
|
Write-Host "Dependencies status:" -ForegroundColor DarkGreen
|
||||||
StateSystemStatus
|
StateSystemStatus
|
||||||
|
|
||||||
$driveLetter = MountPathDrive $distrPath
|
$driveLetter = MountPathDrive $distrPath
|
||||||
$distr = "${driveLetter}`:"
|
$distr = "${driveLetter}`:"
|
||||||
$localHome = "C:\Tools"
|
|
||||||
|
|
||||||
Write-Host "`nEnsure core is updated..." -ForegroundColor DarkGreen
|
Write-Host "`nEnsure core is updated..." -ForegroundColor DarkGreen
|
||||||
PrepareCore $distr $distrPath $standalone $localHome
|
PrepareCore $distr $distrPath $standalone $localHome
|
||||||
|
|
||||||
Write-Host "`nSetup SecureLocation options for $SERVER_PATH" -ForegroundColor DarkGreen
|
Write-Host "`nSetup SecureLocation options for ${SERVER_PATH}" -ForegroundColor DarkGreen
|
||||||
SetupTrustedLocations $SERVER_PATH
|
SetupTrustedLocations $SERVER_PATH
|
||||||
|
|
||||||
Write-Host "`nInitializing template path for Office applications: $TEMPLATES_PATH" -ForegroundColor DarkGreen
|
Write-Host "`nInitializing template path for Office applications: ${TEMPLATES_PATH}" -ForegroundColor DarkGreen
|
||||||
InitializeTemplates $TEMPLATES_PATH
|
InitializeTemplates $TEMPLATES_PATH
|
||||||
|
|
||||||
Write-Host "Update templates at $TEMPLATES_PATH" -ForegroundColor DarkGreen
|
Write-Host "Update templates at ${TEMPLATES_PATH}" -ForegroundColor DarkGreen
|
||||||
UpdateTemplates "${distr}\data\Templates" $TEMPLATES_PATH $localHome
|
UpdateTemplates "${distr}\data\Templates" $TEMPLATES_PATH $localHome
|
||||||
Copy-Item -Path "$TEMPLATES_PATH\Normal.dotm" -Destination "${TEMPLATES_NORMAL_PATH}\Normal.dotm"
|
Copy-Item -Path "${TEMPLATES_PATH}\Normal.dotm" -Destination "${TEMPLATES_NORMAL_PATH}\Normal.dotm"
|
||||||
Copy-Item -Path "$TEMPLATES_PATH\NormalEmail.dotm" -Destination "${TEMPLATES_NORMAL_PATH}\NormalEmail.dotm"
|
Copy-Item -Path "${TEMPLATES_PATH}\NormalEmail.dotm" -Destination "${TEMPLATES_NORMAL_PATH}\NormalEmail.dotm"
|
||||||
|
|
||||||
Write-Host "`nUpdating products..." -ForegroundColor DarkGreen
|
Write-Host "`nUpdating products..." -ForegroundColor DarkGreen
|
||||||
UpdateProducts $distr $TEMPLATES_PATH $localHome
|
UpdateProducts $distr $TEMPLATES_PATH $localHome
|
||||||
|
@ -62,8 +65,8 @@ function InstallAllProducts {
|
||||||
if (-not ($skipShortcuts)) {
|
if (-not ($skipShortcuts)) {
|
||||||
Write-Host "`nInstalling desktop shortcuts" -ForegroundColor DarkGreen
|
Write-Host "`nInstalling desktop shortcuts" -ForegroundColor DarkGreen
|
||||||
Copy-Item -Path "${distr}\data\Shortcuts\*" `
|
Copy-Item -Path "${distr}\data\Shortcuts\*" `
|
||||||
-Destination "$($Env:USERPROFILE)\Desktop\" `
|
-Destination $desktopPath `
|
||||||
-Exclude (Get-ChildItem "$($Env:USERPROFILE)\Desktop") -Force -Recurse
|
-Exclude (Get-ChildItem $desktopPath) -Force -Recurse
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "`nClean up procedure ..." -ForegroundColor Blue
|
Write-Host "`nClean up procedure ..." -ForegroundColor Blue
|
||||||
|
@ -139,7 +142,7 @@ function UpdateProducts($distr, $templates, $localHome) {
|
||||||
$serverManifest = "${distr}\distribution_manifest.json"
|
$serverManifest = "${distr}\distribution_manifest.json"
|
||||||
$serverJSON = Open-DistrManifest $serverManifest
|
$serverJSON = Open-DistrManifest $serverManifest
|
||||||
|
|
||||||
$localManifest = "C:\Tools\distribution_manifest.json"
|
$localManifest = "${localHome}\distribution_manifest.json"
|
||||||
$localJSON = Open-DistrManifest $localManifest
|
$localJSON = Open-DistrManifest $localManifest
|
||||||
$firstRun = $localJSON.Count -eq 0
|
$firstRun = $localJSON.Count -eq 0
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
# Uninstall Concept products
|
# Uninstall Concept products
|
||||||
|
|
||||||
|
$localHome = 'C:\Tools'
|
||||||
|
$desktopPath = [Environment]::GetFolderPath('Desktop')
|
||||||
|
$Env:PSModulePath += ";${localHome}"
|
||||||
|
|
||||||
function UninstallConceptProducts {
|
function UninstallConceptProducts {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
|
@ -19,8 +23,6 @@ function UninstallConceptProducts {
|
||||||
}
|
}
|
||||||
Import-Module -Name ConceptDeploy
|
Import-Module -Name ConceptDeploy
|
||||||
|
|
||||||
$localHome = "C:\Tools"
|
|
||||||
|
|
||||||
Write-Host "`nRemoving Concept Products" -ForegroundColor DarkGreen
|
Write-Host "`nRemoving Concept Products" -ForegroundColor DarkGreen
|
||||||
$localJSON = Open-DistrManifest "$localHome\distribution_manifest.json"
|
$localJSON = Open-DistrManifest "$localHome\distribution_manifest.json"
|
||||||
foreach ($product in $localJSON.Keys) {
|
foreach ($product in $localJSON.Keys) {
|
||||||
|
@ -53,12 +55,12 @@ function UninstallConceptProducts {
|
||||||
|
|
||||||
Write-Host "`nRemoving ConceptDeploy library" -ForegroundColor DarkGreen
|
Write-Host "`nRemoving ConceptDeploy library" -ForegroundColor DarkGreen
|
||||||
Remove-Module -Name ConceptDeploy
|
Remove-Module -Name ConceptDeploy
|
||||||
TryRemove "$env:USERPROFILE\Documents\WindowsPowerShell\modules\ConceptDeploy"
|
TryRemove "${localHome}\ConceptDeploy"
|
||||||
|
|
||||||
Write-Host "`nRemoving desktop shortcuts" -ForegroundColor DarkGreen
|
Write-Host "`nRemoving desktop shortcuts" -ForegroundColor DarkGreen
|
||||||
TryRemove "$($Env:USERPROFILE)\Desktop\Everything - поиск по имени.lnk"
|
TryRemove "${desktopPath}\Everything - поиск по имени.lnk"
|
||||||
TryRemove "$($Env:USERPROFILE)\Desktop\DocFetcher - поиск по содержимому.lnk"
|
TryRemove "${desktopPath}\DocFetcher - поиск по содержимому.lnk"
|
||||||
TryRemove "$($Env:USERPROFILE)\Desktop\Double Commander.lnk"
|
TryRemove "${desktopPath}\Double Commander.lnk"
|
||||||
|
|
||||||
Write-Host "`nUninstallation complete" -ForegroundColor Green
|
Write-Host "`nUninstallation complete" -ForegroundColor Green
|
||||||
|
|
||||||
|
@ -71,7 +73,7 @@ function StartLog {
|
||||||
$ErrorActionPreference = "Continue"
|
$ErrorActionPreference = "Continue"
|
||||||
|
|
||||||
$dateSuffix = (Get-Date -UFormat "%Y%m%d_%I-%M-%S").ToString()
|
$dateSuffix = (Get-Date -UFormat "%Y%m%d_%I-%M-%S").ToString()
|
||||||
$logFile = "$PSScriptRoot\logs\$($dateSuffix)_CP-uninstall_$($Env:USERNAME).txt"
|
$logFile = "${PSScriptRoot}\logs\$($dateSuffix)_CP-uninstall_$($Env:USERNAME).txt"
|
||||||
Start-Transcript -Path $logFile -IncludeInvocationHeader
|
Start-Transcript -Path $logFile -IncludeInvocationHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
# Install Concept products from local distr
|
# Install Concept products from local distr
|
||||||
|
|
||||||
|
|
||||||
|
$localHome = 'C:\Tools'
|
||||||
|
$Env:PSModulePath += ";${localHome}"
|
||||||
|
|
||||||
function UpdateConceptProducts {
|
function UpdateConceptProducts {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
|
@ -18,8 +22,8 @@ function UpdateConceptProducts {
|
||||||
StartLog
|
StartLog
|
||||||
|
|
||||||
Write-Host "Starting update procedure for Concept technologies" -ForegroundColor DarkGreen
|
Write-Host "Starting update procedure for Concept technologies" -ForegroundColor DarkGreen
|
||||||
Write-Host "Sources: $distrPath"
|
Write-Host "Sources: ${distrPath}"
|
||||||
Write-Host "Requested products: $products"
|
Write-Host "Requested products: ${products}"
|
||||||
|
|
||||||
$updates = New-Object System.Collections.Generic.List[System.Object]
|
$updates = New-Object System.Collections.Generic.List[System.Object]
|
||||||
$enable_products = New-Object System.Collections.Generic.List[System.Object]
|
$enable_products = New-Object System.Collections.Generic.List[System.Object]
|
||||||
|
@ -99,6 +103,7 @@ function UpdateProducts($distrPath, $products) {
|
||||||
Write-Host "Installing Powershell library: ConceptDeploy" -ForegroundColor DarkGreen
|
Write-Host "Installing Powershell library: ConceptDeploy" -ForegroundColor DarkGreen
|
||||||
. "$driveLetter\src\ConceptDeploy\CD_Install.ps1"
|
. "$driveLetter\src\ConceptDeploy\CD_Install.ps1"
|
||||||
}
|
}
|
||||||
|
|
||||||
Import-Module -Name ConceptDeploy
|
Import-Module -Name ConceptDeploy
|
||||||
Write-Host "Using ConceptDeploy: $((Get-Module -Name 'ConceptDeploy').Version)" -ForegroundColor Gray
|
Write-Host "Using ConceptDeploy: $((Get-Module -Name 'ConceptDeploy').Version)" -ForegroundColor Gray
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
3.1.0
|
3.2.0
|
Loading…
Reference in New Issue
Block a user