Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MicroWin/AppState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static class AppState
/// </summary>
public static bool EncodeWithB64 { get; set; } = true;
public static bool AddReportingToolShortcut { get; set; } = true;
public static bool UseMSAccount { get; set; } = true;
public static bool CopyUnattendToFileSystem { get; set; }
public static DriverExportMode DriverExportMode { get; set; } = DriverExportMode.NoExport;
public static bool UseUEFICA23Bins { get; set; } = true;
Expand Down
55 changes: 53 additions & 2 deletions MicroWin/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion MicroWin/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ private void ChangePage(WizardPage.Page newPage)
Back_Button.Enabled = !(newPage == WizardPage.Page.WelcomePage) && !(newPage == WizardPage.Page.FinishPage);
ButtonPanel.Visible = !(newPage == WizardPage.Page.IsoCreationPage);

MSAcc_Button.Visible = (newPage != WizardPage.Page.UserAccountsPage);
Setup_Button.Visible = (newPage != WizardPage.Page.UserAccountsPage);

Next_Button.Text = newPage == WizardPage.Page.FinishPage ? "Close" : "Next";

if (CurrentWizardPage.wizardPage == WizardPage.Page.IsoCreationPage)
Expand Down Expand Up @@ -228,6 +231,17 @@ private void Back_Button_Click(object sender, EventArgs e)
ChangePage(CurrentWizardPage.wizardPage - 1);
}

private void MSAcc_Button_Click(object sender, EventArgs e)
{
// TODO: Implement use of MS Account
}


private void Setup_Button_Click(object sender, EventArgs e)
{
// TODO: Implement use of Setup to make accounts
}


private void isoPickerBtn_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -420,7 +434,7 @@ private void usrPasswordRevealCB_CheckedChanged(object sender, EventArgs e)
}
catch
{
// don't play this easter egg
// Don't play this easter egg
}
}
usrPasswordTB.PasswordChar = usrPasswordRevealCB.Checked ? '\0' : '*';
Expand Down
20 changes: 13 additions & 7 deletions MicroWin/functions/dism/UnattendGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ public static void CreateUnattend(string destinationPath, Version? sourceVersion
xml.AppendLine(" </settings>");
xml.AppendLine(" <settings pass=\"oobeSystem\">");
xml.AppendLine(" <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"amd64\" publicKeyToken=\"31bf3856ad364e35\" language=\"neutral\" versionScope=\"nonSxS\">");
xml.AppendLine(" <UserAccounts>");
xml.AppendLine(" <LocalAccounts>");
foreach (var user in AppState.UserAccounts)
if (AppState.UserAccounts.Count > 0)
{
xml.AppendLine(" <UserAccounts>");
xml.AppendLine(" <LocalAccounts>");
xml.AppendLine(" <LocalAccount wcm:action=\"add\">");
xml.AppendLine($" <Password>");
// Determine if we need to encode the password with base64. If we need to, we must append
Expand All @@ -118,17 +118,23 @@ public static void CreateUnattend(string destinationPath, Version? sourceVersion
xml.AppendLine($" <Name>{user.Name}</Name>");
xml.AppendLine($" <Group>{(user.Role == "Administrator" ? "Administrators" : "Users")}</Group>");
xml.AppendLine(" </LocalAccount>");
xml.AppendLine(" </LocalAccounts>");
xml.AppendLine(" </UserAccounts>");
}
xml.AppendLine(" </LocalAccounts>");
xml.AppendLine(" </UserAccounts>");
xml.AppendLine(" <OOBE>");
xml.AppendLine(" <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>");
xml.AppendLine(" <SkipUserOOBE>true</SkipUserOOBE>");
xml.AppendLine(" <SkipMachineOOBE>true</SkipMachineOOBE>");
xml.AppendLine(" <HideOnlineAccountScreens>true</HideOnlineAccountScreens>");
if (AppState.UseMSAccount == true)
{
xml.AppendLine(" <HideOnlineAccountScreens>false</HideOnlineAccountScreens>");
}
else
{
xml.AppendLine(" <HideOnlineAccountScreens>true</HideOnlineAccountScreens>");
}
xml.AppendLine(" <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>");
xml.AppendLine(" <HideEULAPage>true</HideEULAPage>");
xml.AppendLine(" <NetworkLocation>Work</NetworkLocation>");
xml.AppendLine(" <ProtectYourPC>3</ProtectYourPC>");
xml.AppendLine(" </OOBE>");
xml.AppendLine(" <FirstLogonCommands>");
Expand Down
Loading