Skip to content

Commit 9b9e06b

Browse files
committed
Format tidying up
1 parent 3f63113 commit 9b9e06b

4 files changed

Lines changed: 62 additions & 65 deletions

File tree

PowerShellActions/CustomAction.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static ActionResult ScriptsImmediate(Session session, int elevated, stri
176176
try
177177
{
178178
List<ScriptActionData> scripts = new List<ScriptActionData>();
179-
using (View view = db.OpenView(string.Format("SELECT `Id`, `Script`, `IgnoreErrors` FROM `PowerShellScripts` WHERE `Elevated` = {0} ORDER BY `Order`", elevated)))
179+
using (View view = db.OpenView(string.Format("SELECT `Id`, `Script`, `IgnoreErrors`, `Condition` FROM `PowerShellScripts` WHERE `Elevated` = {0} ORDER BY `Order`", elevated)))
180180
{
181181
view.Execute();
182182

@@ -345,7 +345,7 @@ private static ActionResult FilesImmediate(Session session, int elevated, string
345345
try
346346
{
347347
XDocument doc;
348-
using (View view = db.OpenView(string.Format("SELECT `Id`, `File`, `Arguments`, `IgnoreErrors` FROM `{0}` WHERE `Elevated` = {1} ORDER BY `Order`", tableName, elevated)))
348+
using (View view = db.OpenView(string.Format("SELECT `Id`, `File`, `Arguments`, `IgnoreErrors`, `Condition` FROM `{0}` WHERE `Elevated` = {1} ORDER BY `Order`", tableName, elevated)))
349349
{
350350
view.Execute();
351351

@@ -464,15 +464,15 @@ private static ActionResult FilesDeferred(Session session, string deferredProper
464464
{
465465
bool result = task.Execute();
466466
session.Log("PowerShell non-terminating errors: {0}", !result);
467-
if (!result)
467+
if (!result)
468468
{
469469
if (!IgnoreErrors.Equals("0"))
470470
{
471471
session.Log("Ignoring failure due to 'IgnoreErrors' marking");
472472
}
473473
else
474474
{
475-
session.Log("Returning Failure");
475+
session.Log("Returning Failure");
476476
return ActionResult.Failure;
477477
}
478478
}

PowerShellLibrary/Library.wxs

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
Execute="deferred"
1717
Return="check" />
1818

19-
<CustomAction Id="PowerShellScriptsUninstall"
20-
BinaryKey="CA_DLL"
21-
DllEntry="PowerShellScriptsUninstall"
22-
Execute="immediate"
23-
Return="check" />
24-
25-
<CustomAction Id="PowerShellScriptsUninstallDeferred"
26-
BinaryKey="CA_DLL"
27-
DllEntry="PowerShellScriptsUninstallDeferred"
28-
Impersonate="yes"
29-
Execute="deferred"
30-
Return="check" />
19+
<CustomAction Id="PowerShellScriptsUninstall"
20+
BinaryKey="CA_DLL"
21+
DllEntry="PowerShellScriptsUninstall"
22+
Execute="immediate"
23+
Return="check" />
24+
25+
<CustomAction Id="PowerShellScriptsUninstallDeferred"
26+
BinaryKey="CA_DLL"
27+
DllEntry="PowerShellScriptsUninstallDeferred"
28+
Impersonate="yes"
29+
Execute="deferred"
30+
Return="check" />
3131

3232
<CustomAction Id="PowerShellScriptsElevatedImmediate"
3333
BinaryKey="CA_DLL"
@@ -42,18 +42,18 @@
4242
Execute="deferred"
4343
Return="check" />
4444

45-
<CustomAction Id="PowerShellScriptsElevatedUninstall"
46-
BinaryKey="CA_DLL"
47-
DllEntry="PowerShellScriptsElevatedUninstall"
48-
Execute="immediate"
49-
Return="check" />
50-
51-
<CustomAction Id="PowerShellScriptsElevatedUninstallDeferred"
52-
BinaryKey="CA_DLL"
53-
DllEntry="PowerShellScriptsElevatedUninstallDeferred"
54-
Impersonate="no"
55-
Execute="deferred"
56-
Return="check" />
45+
<CustomAction Id="PowerShellScriptsElevatedUninstall"
46+
BinaryKey="CA_DLL"
47+
DllEntry="PowerShellScriptsElevatedUninstall"
48+
Execute="immediate"
49+
Return="check" />
50+
51+
<CustomAction Id="PowerShellScriptsElevatedUninstallDeferred"
52+
BinaryKey="CA_DLL"
53+
DllEntry="PowerShellScriptsElevatedUninstallDeferred"
54+
Impersonate="no"
55+
Execute="deferred"
56+
Return="check" />
5757

5858
<CustomAction Id="PowerShellFilesImmediate"
5959
BinaryKey="CA_DLL"
@@ -68,18 +68,18 @@
6868
Execute="deferred"
6969
Return="check" />
7070

71-
<CustomAction Id="PowerShellFilesUninstall"
72-
BinaryKey="CA_DLL"
73-
DllEntry="PowerShellFilesUninstall"
74-
Execute="immediate"
75-
Return="check" />
71+
<CustomAction Id="PowerShellFilesUninstall"
72+
BinaryKey="CA_DLL"
73+
DllEntry="PowerShellFilesUninstall"
74+
Execute="immediate"
75+
Return="check" />
7676

77-
<CustomAction Id="PowerShellFilesUninstallDeferred"
78-
BinaryKey="CA_DLL"
79-
DllEntry="PowerShellFilesUninstallDeferred"
80-
Impersonate="yes"
81-
Execute="deferred"
82-
Return="check" />
77+
<CustomAction Id="PowerShellFilesUninstallDeferred"
78+
BinaryKey="CA_DLL"
79+
DllEntry="PowerShellFilesUninstallDeferred"
80+
Impersonate="yes"
81+
Execute="deferred"
82+
Return="check" />
8383

8484
<CustomAction Id="PowerShellFilesElevatedImmediate"
8585
BinaryKey="CA_DLL"
@@ -94,20 +94,20 @@
9494
Execute="deferred"
9595
Return="check" />
9696

97-
<CustomAction Id="PowerShellFilesElevatedUninstall"
98-
BinaryKey="CA_DLL"
99-
DllEntry="PowerShellFilesElevatedUninstall"
100-
Execute="immediate"
101-
Return="check" />
97+
<CustomAction Id="PowerShellFilesElevatedUninstall"
98+
BinaryKey="CA_DLL"
99+
DllEntry="PowerShellFilesElevatedUninstall"
100+
Execute="immediate"
101+
Return="check" />
102102

103-
<CustomAction Id="PowerShellFilesElevatedUninstallDeferred"
104-
BinaryKey="CA_DLL"
105-
DllEntry="PowerShellFilesElevatedUninstallDeferred"
106-
Impersonate="no"
107-
Execute="deferred"
108-
Return="check" />
103+
<CustomAction Id="PowerShellFilesElevatedUninstallDeferred"
104+
BinaryKey="CA_DLL"
105+
DllEntry="PowerShellFilesElevatedUninstallDeferred"
106+
Impersonate="no"
107+
Execute="deferred"
108+
Return="check" />
109109

110-
<InstallExecuteSequence>
110+
<InstallExecuteSequence>
111111
<!-- These are the 'immediate' actions that prep the data for the 'deferred' actions-->
112112
<Custom Action="PowerShellScriptsImmediate" Before="PowerShellScriptsDeferred" Overridable="yes">NOT Installed</Custom>
113113

@@ -127,23 +127,23 @@
127127
<Custom Action="PowerShellFilesElevatedDeferred" After="InstallFiles" Overridable="yes">NOT Installed</Custom>
128128

129129
<!-- 'Uninstall immediate' actions -->
130-
<Custom Action="PowerShellScriptsUninstall" Before="PowerShellScriptsUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
130+
<Custom Action="PowerShellScriptsUninstall" Before="PowerShellScriptsUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
131131

132-
<Custom Action="PowerShellScriptsElevatedUninstall" Before="PowerShellScriptsElevatedUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
132+
<Custom Action="PowerShellScriptsElevatedUninstall" Before="PowerShellScriptsElevatedUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
133133

134-
<Custom Action="PowerShellFilesUninstall" Before="PowerShellFilesUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
134+
<Custom Action="PowerShellFilesUninstall" Before="PowerShellFilesUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
135135

136-
<Custom Action="PowerShellFilesElevatedUninstall" Before="PowerShellFilesElevatedUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
136+
<Custom Action="PowerShellFilesElevatedUninstall" Before="PowerShellFilesElevatedUninstallDeferred" Overridable="yes">REMOVE="ALL"</Custom>
137137

138-
<!-- 'Uninstall deferred' actions -->
139-
<Custom Action="PowerShellScriptsUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
138+
<!-- 'Uninstall deferred' actions -->
139+
<Custom Action="PowerShellScriptsUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
140140

141-
<Custom Action="PowerShellScriptsElevatedUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
141+
<Custom Action="PowerShellScriptsElevatedUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
142142

143-
<Custom Action="PowerShellFilesUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
143+
<Custom Action="PowerShellFilesUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
144144

145-
<Custom Action="PowerShellFilesElevatedUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
146-
</InstallExecuteSequence>
145+
<Custom Action="PowerShellFilesElevatedUninstallDeferred" After="RemoveFiles" Overridable="yes">REMOVE="ALL"</Custom>
146+
</InstallExecuteSequence>
147147

148148
<UI>
149149
<ProgressText Action="PowerShellFilesDeferred">PowerShell Files</ProgressText>

PowerShellWixExtension.nuspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata minClientVersion="2.7">
44
<id>PowerShellWixExtension</id>
5-
<version>4.0.0</version>
5+
<version>2.1.0</version>
66
<title>Wix Extension for PowerShell</title>
77
<summary>Wix Extension that allows running PowerShell scripts</summary>
88
<description>An extension for Wix that allows running PowerShell scripts, either from .ps1 files included in the MSI, or by embedding PowerShell script directly</description>
@@ -14,7 +14,6 @@
1414
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1515
<tags>WiX PowerShell MSI Installer WixToolset XML</tags>
1616
<releaseNotes>$releasenotes$</releaseNotes>
17-
* Support for running scripts on uninstall (from @gzidar)
1817
</metadata>
1918
<files>
2019
<file src="NuGet\content\*.*" target="content" />

PowerShellWixExtension/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,4 @@
2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
2323
[assembly: Guid("7abfedd7-d0f1-489a-a1f4-fb5e3e0bd038")]
2424

25-
[assembly: AssemblyVersion("3.0.0.0")]
26-
[assembly: AssemblyFileVersion("3.0.0.0")]
2725
[assembly: AssemblyDefaultWixExtension(typeof(PowerShellWixExtension.PowerShellWixExtension))]

0 commit comments

Comments
 (0)