mirror of
https://github.com/winapps-org/winapps.git
synced 2025-08-14 06:19:15 +02:00
doc: run install.bat on libvirt
This commit is contained in:
@@ -1,47 +1,13 @@
|
||||
@echo off
|
||||
REM Copyright (c) 2024 Oskar Manhart
|
||||
REM Copyright (c) 2024 itiligent
|
||||
REM All rights reserved.
|
||||
REM
|
||||
REM SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
REG IMPORT C:\OEM\RDPApps.reg
|
||||
reg import %~dp0\RDPApps.reg
|
||||
|
||||
:: Create Powershell network profile cleanup script
|
||||
(
|
||||
echo # Get the current network profile name
|
||||
echo $currentProfile = ^(Get-NetConnectionProfile^).Name
|
||||
echo.
|
||||
echo # Get all profiles from the registry
|
||||
echo $profilesKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles"
|
||||
echo $profiles = Get-ChildItem -Path $profilesKey
|
||||
echo.
|
||||
echo foreach ^($profile in $profiles^) {
|
||||
echo $profilePath = "$profilesKey\$($profile.PSChildName)"
|
||||
echo $profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName
|
||||
echo.
|
||||
echo # Remove profiles that don't match the current one
|
||||
echo if ^($profileName -ne $currentProfile^) {
|
||||
echo Remove-Item -Path $profilePath -Recurse
|
||||
echo Write-Host "Deleted profile: $profileName"
|
||||
echo }
|
||||
echo }
|
||||
echo.
|
||||
echo # Change the current profile name to "WinApps"
|
||||
echo $profiles = Get-ChildItem -Path $profilesKey
|
||||
echo foreach ^($profile in $profiles^) {
|
||||
echo $profilePath = "$profilesKey\$($profile.PSChildName)"
|
||||
echo $profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName
|
||||
echo.
|
||||
echo if ^($profileName -eq $currentProfile^) {
|
||||
echo # Update the profile name
|
||||
echo Set-ItemProperty -Path $profilePath -Name "ProfileName" -Value "WinApps"
|
||||
echo Write-Host "Renamed profile to: WinApps"
|
||||
echo }
|
||||
echo }
|
||||
) > %windir%\NetProfileCleanup.ps1
|
||||
if exists %~dp0\Container.reg (
|
||||
reg import %~dp0\Container.reg
|
||||
)
|
||||
|
||||
:: Create network profile cleanup scheduled task
|
||||
REM Create network profile cleanup scheduled task
|
||||
copy %~dp0\NetProfileCleanup.ps1 %windir%
|
||||
set "taskname=NetworkProfileCleanup"
|
||||
set "command=powershell.exe -ExecutionPolicy Bypass -File "%windir%\NetProfileCleanup.ps1^""
|
||||
|
||||
|
Reference in New Issue
Block a user