Skip to content

Commit 11aa2d1

Browse files
committed
[Unattended answer file] Add Starter Script files
1 parent cdf65dd commit 11aa2d1

File tree

5 files changed

+907
-818
lines changed

5 files changed

+907
-818
lines changed

DISMTools.vbproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@
12011201
<None Include="docs\css\fonts\Roboto-Slab-Regular.woff2" />
12021202
<None Include="docs\search\search_index.json" />
12031203
<None Include="docs\sitemap.xml.gz" />
1204+
<None Include="Elements\AutoUnattend\StarterScripts\WhenFirstUserLogsOn\Set up a custom wallpaper.dtss" />
12041205
<None Include="Helpers\dthelper.bat">
12051206
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
12061207
</None>
@@ -1876,6 +1877,8 @@
18761877
</ItemGroup>
18771878
<ItemGroup>
18781879
<Folder Include="bin\Debug\" />
1880+
<Folder Include="Elements\AutoUnattend\StarterScripts\DuringSystemConfiguration\" />
1881+
<Folder Include="Elements\AutoUnattend\StarterScripts\WhenUsersLogOnForFirstTime\" />
18791882
<Folder Include="Helpers\extps1\PE_Helper\files\diskpart\" />
18801883
<Folder Include="Helpers\extps1\PE_Helper\tools\HotInstall\" />
18811884
<Folder Include="Panels\Set_Ops\" />
@@ -2004,6 +2007,9 @@ IF EXIST "$(SolutionDir)tour" (
20042007
IF NOT EXIST AutoUnattend (
20052008
md AutoUnattend
20062009
copy /y "$(SolutionDir)Elements\AutoUnattend\*.xml" AutoUnattend
2010+
IF EXIST "$(ProjectDir)Elements\AutoUnattend\StarterScripts" (
2011+
xcopy "$(ProjectDir)Elements\AutoUnattend\StarterScripts\*.*" AutoUnattend\StarterScripts /cehyi
2012+
)
20072013
)
20082014

20092015
IF %25ISPREVIEW%25=="Yes" (
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Language: PowerShell
2+
3+
Add-Type -Language CSharp -TypeDefinition @"
4+
using System;
5+
using System.Runtime.InteropServices;
6+
7+
public class WinAPI {
8+
[DllImport("user32.dll", CharSet = CharSet.Auto)]
9+
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
10+
}
11+
"@
12+
13+
$SPI_SETDESKWALLPAPER = 0x0014 # This sets the desktop wallpaper
14+
$SPIF_UPDATEINIFILE = 0x01 # This writes the change to the user profile
15+
$SPIF_SENDCHANGE = 0x02 # This broadcasts a WM_SETTINGCHANGE message
16+
17+
# More information about the SystemParametersInfo API:
18+
# https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa
19+
20+
# NOTE: the wallpaper path must be either an absolute path or a relative path to the picture
21+
# file in **the target Windows installation**. DO NOT PUT A PATH TO YOUR CURRENT WALLPAPER IF
22+
# IT DOESN'T EXIST ON THE TARGET INSTALLATION. If the file does not exist, you will see a
23+
# black desktop background.
24+
[WinAPI]::SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, "<path to your wallpaper here>", $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)

0 commit comments

Comments
 (0)