Skip to content

Commit 7cc0dc0

Browse files
committed
Release v1.4.9.0
- Issue #172: Request for IsSilent() extension method - Issue #166: How to make a Single Package Authoring - XElement extension method `AddOrUpdateElement` has been renamed in `SetElementValue` - Added AddOrUpdateElement XElement extension method - Updated SelectOrCreate XContainer extension method to handle XDocument objects - Added support for Bundle downgrade detection and graceful exit from SilentBootstrapperApplication BA - Updated sample DeferredActiosn sample with extra ConfigFile manipulation code. To assist with question #165. - Issue #160: Question: Registry Key Permissions Handling - Implemented changing the title and description of the ManagedUI.ExitDialog depending on the Install error or cancellation.
1 parent d22dec8 commit 7cc0dc0

10 files changed

Lines changed: 90 additions & 73 deletions

File tree

Source/src/WixSharp.Samples/Support/testpad/setup.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ static void prepare_dirs(string root)
2626
}
2727

2828
static public void Main(string[] args)
29+
{
30+
var project = new ManagedProject("IsUninstallTest",
31+
new Dir(@"%ProgramFiles%\UninstallTest\",
32+
new File("setup.cs")));
33+
34+
project.AfterInstall += Project_AfterInstall;
35+
36+
project.BuildMsi();
37+
}
38+
39+
private static void Project_AfterInstall(SetupEventArgs e)
40+
{
41+
System.Windows.Forms.MessageBox.Show("Is Uninstalling: " + e.IsUninstalling);
42+
if (e.IsUninstalling)
43+
{
44+
// e.IsUninstalling is always false if the uninstall is triggered via executing the msi again
45+
// and click remove in the maintenance dialog
46+
}
47+
}
48+
49+
static public void Main2(string[] args)
2950
{
3051
var project = new ManagedProject("MyProduct",
3152
new Dir(@"C:\My Company\My Product",

Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/SetupEvents/setup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void project_AfterInstall(SetupEventArgs e)
129129
"\npersisted_data = " + e.Data["persisted_data"] +
130130
"\nEnvVar('INSTALLDIR') -> " + Environment.ExpandEnvironmentVariables("%INSTALLDIR%My App.exe") +
131131
"\nADDLOCAL = " + e.Session.Property("ADDLOCAL"),
132-
caption: "AfterExecute ");
132+
caption: "AfterInstall ");
133133
try
134134
{
135135
System.IO.File.WriteAllText(@"C:\Program Files (x86)\My Company\My Product\Docs\readme.txt", "test");

Source/src/WixSharp.Samples/Wix# Samples/Reboot/setup.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ static public void Main(string[] args)
1919
new ManagedAction("PromptToReboot"));
2020

2121
//You can also control rebooting via dedicated WiX/Wix# project properties
22-
//project.ScheduleReboot = new ScheduleReboot { InstallSequence = RebootInstallSequence.Both };
23-
//project.ForceReboot = new ForceReboot();
24-
//project.RebootSupressing = RebootSupressing.ReallySuppress;
22+
// project.ScheduleReboot = new ScheduleReboot { InstallSequence = RebootInstallSequence.Both };
23+
// project.ForceReboot = new ForceReboot();
24+
// project.RebootSupressing = RebootSupressing.ReallySuppress;
2525

2626
project.UI = WUI.WixUI_ProgressOnly;
2727
project.PreserveTempFiles = true;
@@ -35,15 +35,11 @@ public class CustonActions
3535
[CustomAction]
3636
public static ActionResult PromptToReboot(Session session)
3737
{
38-
3938
if (DialogResult.Yes == MessageBox.Show("You need to reboot the system.\nDo you want to reboot now?", "ReboolTest", MessageBoxButtons.YesNo))
4039
{
4140
Process.Start("shutdown.exe", "-r -t 30 -c \"Reboot has been requested from RebootTest.msi\"");
4241
}
4342

4443
return ActionResult.Success;
4544
}
46-
}
47-
48-
49-
45+
}
-1.5 KB
Binary file not shown.
-5 KB
Binary file not shown.

Source/src/WixSharp.Samples/WixSharp.UI.xml

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-20.5 KB
Binary file not shown.

Source/src/WixSharp.Samples/WixSharp.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3978,10 +3978,10 @@
39783978
<summary>
39793979
Value of the <c>REBOOT</c> property.
39803980
The REBOOT property suppresses certain prompts for a restart of the system. An administrator typically uses this
3981-
property with a series of installations to install several products at the same time with only one restart at the
3981+
property with a series of installations to install several products at the same time with only one restart at the
39823982
end. For more information, see System Reboots.
39833983
<para>
3984-
The ForceReboot and ScheduleReboot actions inform the installer to prompt the user to restart the system. The
3984+
The ForceReboot and ScheduleReboot actions inform the installer to prompt the user to restart the system. The
39853985
installer can also determine that a restart is necessary whether there are any ForceReboot or ScheduleReboot actions
39863986
in the sequence. For example, the installer automatically prompts for a restart if it needs to replace any files in
39873987
use during the installation.
@@ -3991,31 +3991,31 @@
39913991
<member name="F:WixSharp.RebootSupressing.Force">
39923992
<summary>
39933993
Always prompt for a restart at the end of the installation. The UI always prompts the user with an option to
3994-
restart at the end. If there is no user interface, and this is not a multiple-package installation, the system
3995-
automatically restarts at the end of the installation. If this is a multiple-package installation, there is no
3994+
restart at the end. If there is no user interface, and this is not a multiple-package installation, the system
3995+
automatically restarts at the end of the installation. If this is a multiple-package installation, there is no
39963996
automatic restart of the system and the installer returns ERROR_SUCCESS_REBOOT_REQUIRED.
39973997
</summary>
39983998
</member>
39993999
<member name="F:WixSharp.RebootSupressing.Suppress">
40004000
<summary>
4001-
Suppress prompts for a restart at the end of the installation. The installer still prompts the user with an
4002-
option to restart during the installation whenever it encounters the ForceReboot action. If there is no user
4003-
interface, the system automatically restarts at each ForceReboot. Restarts at the end of the installation
4001+
Suppress prompts for a restart at the end of the installation. The installer still prompts the user with an
4002+
option to restart during the installation whenever it encounters the ForceReboot action. If there is no user
4003+
interface, the system automatically restarts at each ForceReboot. Restarts at the end of the installation
40044004
(for example, caused by an attempt to install a file in use) are suppressed.
40054005
</summary>
40064006
</member>
40074007
<member name="F:WixSharp.RebootSupressing.ReallySuppress">
40084008
<summary>
4009-
Suppress all restarts and restart prompts initiated by ForceReboot during the installation. Suppress all restarts
4010-
and restart prompts at the end of the installation. Both the restart prompt and the restart itself are suppressed.
4009+
Suppress all restarts and restart prompts initiated by ForceReboot during the installation. Suppress all restarts
4010+
and restart prompts at the end of the installation. Both the restart prompt and the restart itself are suppressed.
40114011
For example, restarts at the end of the installation, caused by an attempt to install a file in use, are suppressed.
40124012
</summary>
40134013
</member>
40144014
<member name="T:WixSharp.ForceReboot">
40154015
<summary>
4016-
Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence
4017-
number and thus must appear relative to another action. The suggested way to do this is by using the Before or After
4018-
attribute.
4016+
Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence
4017+
number and thus must appear relative to another action. The suggested way to do this is by using the Before or After
4018+
attribute.
40194019
InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize.
40204020
</summary>
40214021
</member>
@@ -4041,7 +4041,7 @@
40414041
</member>
40424042
<member name="F:WixSharp.ForceReboot.InstallSequence">
40434043
<summary>
4044-
The parent install sequence. The only avalable sequence for this element is <c>InstallExecuteSequence</c>.
4044+
The parent install sequence. The only available sequence for this element is <c>InstallExecuteSequence</c>.
40454045
</summary>
40464046
</member>
40474047
<member name="F:WixSharp.ForceReboot.Overridable">
@@ -4051,15 +4051,15 @@
40514051
</member>
40524052
<member name="T:WixSharp.ScheduleReboot">
40534053
<summary>
4054-
Prompts the user to restart the system at the end of installation. Special actions don't have a built-in
4055-
sequence number and thus must appear relative to another action. The suggested way to do this is by using
4056-
the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between
4054+
Prompts the user to restart the system at the end of installation. Special actions don't have a built-in
4055+
sequence number and thus must appear relative to another action. The suggested way to do this is by using
4056+
the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between
40574057
InstallInitialize and InstallFinalize.
40584058
</summary>
40594059
</member>
40604060
<member name="F:WixSharp.ScheduleReboot.InstallSequence">
40614061
<summary>
4062-
Indicates what install sequence should ScheduleReboot be placed to.
4062+
Indicates what install sequence should ScheduleReboot be placed to.
40634063
</summary>
40644064
</member>
40654065
<member name="T:WixSharp.Extensions">

Source/src/WixSharp/Properties/AssemblyInfo.version.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
// Build Number
88
// Revision
99
//
10-
[assembly: AssemblyVersion("1.4.8.0")]
11-
[assembly: AssemblyFileVersion("1.4.8.0")]
10+
[assembly: AssemblyVersion("1.4.9.0")]
11+
[assembly: AssemblyFileVersion("1.4.9.0")]

Source/src/WixSharp/Reboot.cs

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ public enum RebootInstallSequence
4040
/// InstallExecuteSequence
4141
/// </summary>
4242
InstallExecute,
43+
4344
/// <summary>
4445
/// InstallUISequence
4546
/// </summary>
4647
InstallUI,
48+
4749
/// <summary>
4850
/// The both InstallExecuteSequence and InstallUISequence
4951
/// </summary>
@@ -53,10 +55,10 @@ public enum RebootInstallSequence
5355
/// <summary>
5456
/// Value of the <c>REBOOT</c> property.
5557
/// The REBOOT property suppresses certain prompts for a restart of the system. An administrator typically uses this
56-
/// property with a series of installations to install several products at the same time with only one restart at the
58+
/// property with a series of installations to install several products at the same time with only one restart at the
5759
/// end. For more information, see System Reboots.
5860
/// <para>
59-
/// The ForceReboot and ScheduleReboot actions inform the installer to prompt the user to restart the system. The
61+
/// The ForceReboot and ScheduleReboot actions inform the installer to prompt the user to restart the system. The
6062
/// installer can also determine that a restart is necessary whether there are any ForceReboot or ScheduleReboot actions
6163
/// in the sequence. For example, the installer automatically prompts for a restart if it needs to replace any files in
6264
/// use during the installation.
@@ -66,30 +68,32 @@ public enum RebootSupressing
6668
{
6769
/// <summary>
6870
/// Always prompt for a restart at the end of the installation. The UI always prompts the user with an option to
69-
/// restart at the end. If there is no user interface, and this is not a multiple-package installation, the system
70-
/// automatically restarts at the end of the installation. If this is a multiple-package installation, there is no
71+
/// restart at the end. If there is no user interface, and this is not a multiple-package installation, the system
72+
/// automatically restarts at the end of the installation. If this is a multiple-package installation, there is no
7173
/// automatic restart of the system and the installer returns ERROR_SUCCESS_REBOOT_REQUIRED.
7274
/// </summary>
7375
Force,
76+
7477
/// <summary>
75-
/// Suppress prompts for a restart at the end of the installation. The installer still prompts the user with an
76-
/// option to restart during the installation whenever it encounters the ForceReboot action. If there is no user
77-
/// interface, the system automatically restarts at each ForceReboot. Restarts at the end of the installation
78+
/// Suppress prompts for a restart at the end of the installation. The installer still prompts the user with an
79+
/// option to restart during the installation whenever it encounters the ForceReboot action. If there is no user
80+
/// interface, the system automatically restarts at each ForceReboot. Restarts at the end of the installation
7881
/// (for example, caused by an attempt to install a file in use) are suppressed.
7982
/// </summary>
8083
Suppress,
84+
8185
/// <summary>
82-
/// Suppress all restarts and restart prompts initiated by ForceReboot during the installation. Suppress all restarts
83-
/// and restart prompts at the end of the installation. Both the restart prompt and the restart itself are suppressed.
86+
/// Suppress all restarts and restart prompts initiated by ForceReboot during the installation. Suppress all restarts
87+
/// and restart prompts at the end of the installation. Both the restart prompt and the restart itself are suppressed.
8488
/// For example, restarts at the end of the installation, caused by an attempt to install a file in use, are suppressed.
8589
/// </summary>
8690
ReallySuppress
8791
}
8892

8993
/// <summary>
90-
/// Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence
91-
/// number and thus must appear relative to another action. The suggested way to do this is by using the Before or After
92-
/// attribute.
94+
/// Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence
95+
/// number and thus must appear relative to another action. The suggested way to do this is by using the Before or After
96+
/// attribute.
9397
/// InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize.
9498
/// </summary>
9599
public partial class ForceReboot : WixObject
@@ -115,7 +119,7 @@ public partial class ForceReboot : WixObject
115119
public Condition Condition;
116120

117121
/// <summary>
118-
/// The parent install sequence. The only avalable sequence for this element is <c>InstallExecuteSequence</c>.
122+
/// The parent install sequence. The only available sequence for this element is <c>InstallExecuteSequence</c>.
119123
/// </summary>
120124
public const RebootInstallSequence InstallSequence = RebootInstallSequence.InstallExecute;
121125

@@ -133,39 +137,36 @@ internal XElement ToXml()
133137
.AddAttributes(this.Attributes);
134138
}
135139

136-
137-
138140
//not sure support for SequenceNumber is required; disable it out until it's truly needed
139141
//private XElement ToXml_FutureImplementation(string prevActionName = null)
140142
//{
141-
//var element = new XElement(this.GetType().Name, Condition.ToXValue())
142-
// .SetAttribute("Overridable", Overridable)
143-
// .SetAttribute("Suppress", Suppress)
144-
// .SetAttribute("Sequence", SequenceNumber);
145-
146-
//var step = Step?.ToString();
147-
//if (Step == Step.PreviousAction)
148-
// step = prevActionName;
149-
//if (Step == Step.PreviousActionOrInstallInitialize)
150-
// step = prevActionName ?? Step.InstallInitialize.ToString();
151-
//if (step != null)
152-
// element.SetAttribute(When.ToString(), step);
153-
154-
//return element;
143+
//var element = new XElement(this.GetType().Name, Condition.ToXValue())
144+
// .SetAttribute("Overridable", Overridable)
145+
// .SetAttribute("Suppress", Suppress)
146+
// .SetAttribute("Sequence", SequenceNumber);
147+
148+
//var step = Step?.ToString();
149+
//if (Step == Step.PreviousAction)
150+
// step = prevActionName;
151+
//if (Step == Step.PreviousActionOrInstallInitialize)
152+
// step = prevActionName ?? Step.InstallInitialize.ToString();
153+
//if (step != null)
154+
// element.SetAttribute(When.ToString(), step);
155+
156+
//return element;
155157
//}
156-
157158
}
158159

159160
/// <summary>
160-
/// Prompts the user to restart the system at the end of installation. Special actions don't have a built-in
161-
/// sequence number and thus must appear relative to another action. The suggested way to do this is by using
162-
/// the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between
161+
/// Prompts the user to restart the system at the end of installation. Special actions don't have a built-in
162+
/// sequence number and thus must appear relative to another action. The suggested way to do this is by using
163+
/// the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between
163164
/// InstallInitialize and InstallFinalize.
164165
/// </summary>
165166
public partial class ScheduleReboot : ForceReboot
166167
{
167168
/// <summary>
168-
/// Indicates what install sequence should ScheduleReboot be placed to.
169+
/// Indicates what install sequence should ScheduleReboot be placed to.
169170
/// </summary>
170171
public new RebootInstallSequence InstallSequence = RebootInstallSequence.InstallExecute;
171172
}

0 commit comments

Comments
 (0)