update install script

This commit is contained in:
Eric D. Rohler 2021-07-02 11:09:42 -04:00
parent 0a9190489f
commit 44f8386cec

View File

@ -8,28 +8,69 @@
# }
# Disable UAC
Try {
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /t REG_DWORD /f /v "EnableLUA" /d "0"
Write-Host "UAC is now disabled."
}
Catch {
Write-Host "Error - Exception caught in disabling UAC : $error[0]"
$uac_reg_value = Get-ItemPropertyValue -Path Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA
if(-not $uac_reg_value -eq 0)
{
Try {
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /t REG_DWORD /f /v "EnableLUA" /d "0"
Write-Host "UAC is now disabled."
}
Catch {
Write-Host "Error - Exception caught in disabling UAC : $error[0]"
}
} else {
Write-Host "UAC is Disabled"
}
# Enable Developer Mode
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"
$dev_mode_alldev_reg_value = Get-ItemPropertyValue -Path Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense
$dev_mode_allapp_reg_value = Get-ItemPropertyValue -Path Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowAllTrustedApps
if(-not $dev_mode_alldev_reg_value -eq 1 -or -not $dev_mode_allapp_reg_value -eq 1)
{
try {
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"
}
catch {
Write-Host "Error - Exception caught in Enabling Developer Mode: $error[0]"
}
} else {
write-Host "Developer Mode is Enabled"
}
# Set environmenmt variables
## CMDER_ROOT
[System.Environment]::SetEnvironmentVariable('CMDER_ROOT',"$($env:USERPROFILE)\Cmder", [System.EnvironmentVariableTarget]::Machine)
if(-not $env:CMDER_ROOT)
{
[System.Environment]::SetEnvironmentVariable('CMDER_ROOT',"$($env:USERPROFILE)\Cmder", [System.EnvironmentVariableTarget]::Machine)
}
else {
Write-Host "CMDER_ROOT=$env:CMDER_ROOT"
}
# DEV_PATH --Use this per-machine, i.e. laptops sometimes only have a single disk and desktops have multiple disks
$dev_path = Read-Host -Prompt 'Input the Repos Path:'
[System.Environment]::SetEnvironmentVariable('DEV_PATH', $dev_path, [System.EnvironmentVariableTarget]::Machine)
if(-not $env:DEV_PATH)
{
$dev_path = Read-Host -Prompt 'Input the Repos Path:'
[System.Environment]::SetEnvironmentVariable('DEV_PATH', $dev_path, [System.EnvironmentVariableTarget]::Machine)
}
else {
Write-Host "DEV_PATH=$env:DEV_PATH"
}
# NC_PATH --Use this per-machine
$nc_path = Read-Host -Prompt 'Input the Nextcloud Path:'
[System.Environment]::SetEnvironmentVariable('NC_PATH', $nc_path, [System.EnvironmentVariableTarget]::Machine)
if(-not $env:NC_PATH)
{
$nc_path = Read-Host -Prompt 'Input the Nextcloud Path:'
[System.Environment]::SetEnvironmentVariable('NC_PATH', $nc_path, [System.EnvironmentVariableTarget]::Machine)
} else {
Write-Host "NC_PATH=$env:NC_PATH"
}
# User Profile
Write-Host "User Profile Directory: $($env:USERPROFILE)"