Skip to content

Commit

Permalink
Move commands to the XML file
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Herranz Ramírez committed Jan 20, 2025
1 parent 5477236 commit 5892894
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
16 changes: 16 additions & 0 deletions data/wsl/Autounattend_UEFI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,22 @@
<Order>58</Order>
<Path>powershell.exe Set-ItemProperty -Path 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop\' -Name Enabled -Value 0</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>59</Order>
<Path>powershell.exe wmic UserAccount set PasswordExpires=False</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>60</Order>
<Path>%windir%\System32\reg.exe ADD HKLM\Software\Policies\Microsoft\Windows /v Explorer</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>61</Order>
<Path>%windir%\System32\reg.exe ADD HKLM\Software\Policies\Microsoft\Windows\Explorer /v DisableNotificationCenter /t REG_DWORD /d 1</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>62</Order>
<Path>%windir%\System32\reg.exe ADD HKLM\Software\Microsoft\Windows\CurrentVersion\PushNotifications /v ToastEnabled /t REG_DWORD /d 0</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
Expand Down
Binary file modified data/wsl/autounattend_uefi.iso
Binary file not shown.
26 changes: 0 additions & 26 deletions tests/wsl/install/win_installation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,6 @@ sub run {
wait_still_screen stilltime => 15, timeout => 60;
assert_screen(['windows-desktop', 'windows-edge-decline', 'networks-popup-be-discoverable', 'windows-start-menu', 'windows-qemu-drivers'], timeout => 120);
}

# TODO: all this part should be added to the unattend XML in the future

# Setup stable lock screen background
# record_info('Config lockscreen', 'Setup stable lock screen background');
# $self->use_search_feature('lock screen settings');
# assert_screen 'windows-lock-screen-in-search';
# wait_still_screen stilltime => 2, timeout => 10, similarity_level => 43;
# assert_and_click 'windows-lock-screen-in-search', dclick => 1;
# assert_screen 'windows-lock-screen-settings';
# assert_and_click 'windows-lock-screen-background';
# assert_and_click 'windows-select-picture';
# assert_and_click 'windows-close-lockscreen';
# wait_still_screen stilltime => 2, timeout => 10, similarity_level => 43;

# These commands disable notifications that Windows shows randomly and
# make our windows lose focus
$self->open_powershell_as_admin;
$self->run_in_powershell(cmd => 'reg add "HKLM\Software\Policies\Microsoft\Windows" /v Explorer');
$self->run_in_powershell(cmd => 'reg add "HKLM\Software\Policies\Microsoft\Windows\Explorer" /v DisableNotificationCenter /t REG_DWORD /d 1');
$self->run_in_powershell(cmd => 'reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\PushNotifications" /v ToastEnabled /t REG_DWORD /d 0');
# Prevent password from expiring:
$self->run_in_powershell(cmd => 'wmic UserAccount set PasswordExpires=False');
record_info 'Port close', 'Closing serial port...';
$self->run_in_powershell(cmd => '$port.close()', code => sub { });
$self->run_in_powershell(cmd => 'exit', code => sub { });
}

1;

0 comments on commit 5892894

Please sign in to comment.