update install script
This commit is contained in:
parent
0a9190489f
commit
44f8386cec
61
install.ps1
61
install.ps1
@ -8,28 +8,69 @@
|
|||||||
# }
|
# }
|
||||||
|
|
||||||
# Disable UAC
|
# Disable UAC
|
||||||
Try {
|
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /t REG_DWORD /f /v "EnableLUA" /d "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."
|
Write-Host "UAC is now disabled."
|
||||||
}
|
}
|
||||||
Catch {
|
Catch {
|
||||||
Write-Host "Error - Exception caught in disabling UAC : $error[0]"
|
Write-Host "Error - Exception caught in disabling UAC : $error[0]"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "UAC is Disabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Enable Developer Mode
|
# 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
|
# Set environmenmt variables
|
||||||
## CMDER_ROOT
|
## 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 --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:'
|
if(-not $env:DEV_PATH)
|
||||||
[System.Environment]::SetEnvironmentVariable('DEV_PATH', $dev_path, [System.EnvironmentVariableTarget]::Machine)
|
{
|
||||||
|
$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 --Use this per-machine
|
||||||
$nc_path = Read-Host -Prompt 'Input the Nextcloud Path:'
|
if(-not $env:NC_PATH)
|
||||||
[System.Environment]::SetEnvironmentVariable('NC_PATH', $nc_path, [System.EnvironmentVariableTarget]::Machine)
|
{
|
||||||
|
$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
|
# User Profile
|
||||||
Write-Host "User Profile Directory: $($env:USERPROFILE)"
|
Write-Host "User Profile Directory: $($env:USERPROFILE)"
|
||||||
|
Loading…
Reference in New Issue
Block a user