mirror of
https://github.com/winapps-org/winapps.git
synced 2025-08-02 00:46:42 +02:00
doc: run install.bat on libvirt
This commit is contained in:
4
oem/Container.reg
Normal file
4
oem/Container.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
|
||||
"RealTimeIsUniversal"=dword:00000001
|
30
oem/NetProfileCleanup.ps1
Normal file
30
oem/NetProfileCleanup.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
# Get the current network profile name
|
||||
$currentProfile = ^(Get-NetConnectionProfile^).Name
|
||||
|
||||
# Get all profiles from the registry
|
||||
$profilesKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles"
|
||||
$profiles = Get-ChildItem -Path $profilesKey
|
||||
|
||||
foreach ^($profile in $profiles^) {
|
||||
$profilePath = "$profilesKey\$($profile.PSChildName)"
|
||||
$profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName
|
||||
|
||||
# Remove profiles that don't match the current one
|
||||
if ^($profileName -ne $currentProfile^) {
|
||||
Remove-Item -Path $profilePath -Recurse
|
||||
Write-Host "Deleted profile: $profileName"
|
||||
}
|
||||
}
|
||||
|
||||
# Change the current profile name to "WinApps"
|
||||
$profiles = Get-ChildItem -Path $profilesKey
|
||||
foreach ^($profile in $profiles^) {
|
||||
$profilePath = "$profilesKey\$($profile.PSChildName)"
|
||||
$profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName
|
||||
|
||||
if ^($profileName -eq $currentProfile^) {
|
||||
# Update the profile name
|
||||
Set-ItemProperty -Path $profilePath -Name "ProfileName" -Value "WinApps"
|
||||
Write-Host "Renamed profile to: WinApps"
|
||||
}
|
||||
}
|
@@ -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