Skip to content

Commit

Permalink
wix4: #1641: How to set or use Launchcondition Action in Wix#
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-shilo committed Sep 20, 2024
1 parent 81e2728 commit dcd939c
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ public UserNameDialog()

void dialog_Load(object sender, EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

name.Text = Defaults.UserName;
password.Text = Runtime.Session["PASSWORD"];

localDomain.Checked = true;

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
7 changes: 5 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/ExitDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public ExitDialog()

void ExitDialog_Load(object sender, System.EventArgs e)
{
image.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Dialog");
image.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Dialog") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Dialog");

if (Shell.UserInterrupted || Shell.Log.Contains("User cancelled installation."))
{
title.Text = "[UserExitTitle]";
Expand All @@ -33,7 +35,8 @@ void ExitDialog_Load(object sender, System.EventArgs e)
this.Localize();
}

ResetLayout();
if (image.Image != null)
ResetLayout();

// show error message if required
// if (Shell.Errors.Any())
Expand Down
7 changes: 5 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/FeaturesDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ void FeaturesDialog_Load(object sender, System.EventArgs e)

ReadOnlyTreeNode.Behavior.AttachTo(featuresTree, drawTextOnly);

banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

BuildFeaturesHierarchy();

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
6 changes: 4 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/InstallDirDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public InstallDirDialog()

void InstallDirDialog_Load(object sender, EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

installDirProperty = Runtime.Session.Property("WixSharp_UI_INSTALLDIR");

Expand All @@ -43,7 +44,8 @@ void InstallDirDialog_Load(object sender, EventArgs e)
installDir.Text = installDirPropertyValue;
}

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
6 changes: 4 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/InstallScopeDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ void InstallScopeDialog_Load(object sender, EventArgs e)
this.userScopeRadioButton.Checked = true;
}

banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

this.installDirProperty = Runtime.Session.Property("WixSharp_UI_INSTALLDIR");

Expand All @@ -68,7 +69,8 @@ void InstallScopeDialog_Load(object sender, EventArgs e)
installDir.Text = Environment.ExpandEnvironmentVariables(installDirPropertyValue);
}

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
7 changes: 5 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/LicenceDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ public LicenceDialog()

void LicenceDialog_Load(object sender, EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

agreement.Rtf = Runtime.Session.GetResourceString("WixSharp_LicenceFile");
accepted.Checked = Runtime.Session["LastLicenceAcceptedChecked"] == "True";

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ void cancel_Click(object sender, System.EventArgs e)

void MaintenanceTypeDialog_Load(object sender, System.EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
6 changes: 4 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/ProgressDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public ProgressDialog()

void ProgressDialog_Load(object sender, EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

if (!WindowsIdentity.GetCurrent().IsAdmin() && Uac.IsEnabled())
{
Expand All @@ -40,7 +41,8 @@ void ProgressDialog_Load(object sender, EventArgs e)
showWaitPromptTimer.Start();
}

ResetLayout();
if (banner.Image != null)
ResetLayout();

Shell.StartExecute();
}
Expand Down
6 changes: 4 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/SetupTypeDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ void cancel_Click(object sender, System.EventArgs e)

void SetupTypeDialog_Load(object sender, System.EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Banner");

ResetLayout();
if (banner.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down
6 changes: 4 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/WelcomeDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ public WelcomeDialog()

void WelcomeDialog_Load(object sender, EventArgs e)
{
image.Image = Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Dialog");
image.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Dialog") ??
Runtime.Session.GetResourceBitmap("WixSharpUI_Bmp_Dialog");

ResetLayout();
if (image.Image != null)
ResetLayout();
}

void ResetLayout()
Expand Down

0 comments on commit dcd939c

Please sign in to comment.