WIXFEAT:6210 Change data type of versions to strings.
Sean Hall committed
Oct 18, 2020 at 22:37 UTC
c9d14eb51e4b8458fd5e2738fcc7d1c1129ad22e
21 files changed
+185
-123
src/WixToolset.Mba.Core/BootstrapperApplication.cs
+12
-12
@@ -1130,9 +1130,9 @@ namespace WixToolset.Mba.Core
1130
return args.HResult;
1131
}
1132
1133
- int IBootstrapperApplication.OnDetectForwardCompatibleBundle(string wzBundleId, RelationType relationType, string wzBundleTag, bool fPerMachine, long version, ref bool fCancel, ref bool fIgnoreBundle)
1133
+ int IBootstrapperApplication.OnDetectForwardCompatibleBundle(string wzBundleId, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, ref bool fCancel, ref bool fIgnoreBundle)
1134
{
1135
- DetectForwardCompatibleBundleEventArgs args = new DetectForwardCompatibleBundleEventArgs(wzBundleId, relationType, wzBundleTag, fPerMachine, version, fCancel, fIgnoreBundle);
1135
+ DetectForwardCompatibleBundleEventArgs args = new DetectForwardCompatibleBundleEventArgs(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fCancel, fIgnoreBundle);
1136
this.OnDetectForwardCompatibleBundle(args);
1137
1138
fCancel = args.Cancel;
@@ -1150,9 +1150,9 @@ namespace WixToolset.Mba.Core
1150
return args.HResult;
1151
}
1152
1153
- int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, long dw64Version, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates)
1153
+ int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, string wzVersion, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates)
1154
{
1155
- DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, dw64Version, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates);
1155
+ DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, wzVersion, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates);
1156
this.OnDetectUpdate(args);
1157
1158
fCancel = args.Cancel;
@@ -1169,9 +1169,9 @@ namespace WixToolset.Mba.Core
1169
return args.HResult;
1170
}
1171
1172
- int IBootstrapperApplication.OnDetectRelatedBundle(string wzProductCode, RelationType relationType, string wzBundleTag, bool fPerMachine, long version, RelatedOperation operation, ref bool fCancel)
1172
+ int IBootstrapperApplication.OnDetectRelatedBundle(string wzProductCode, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, RelatedOperation operation, ref bool fCancel)
1173
{
1174
- DetectRelatedBundleEventArgs args = new DetectRelatedBundleEventArgs(wzProductCode, relationType, wzBundleTag, fPerMachine, version, operation, fCancel);
1174
+ DetectRelatedBundleEventArgs args = new DetectRelatedBundleEventArgs(wzProductCode, relationType, wzBundleTag, fPerMachine, wzVersion, operation, fCancel);
1175
this.OnDetectRelatedBundle(args);
1176
1177
fCancel = args.Cancel;
@@ -1187,18 +1187,18 @@ namespace WixToolset.Mba.Core
1187
return args.HResult;
1188
}
1189
1190
- int IBootstrapperApplication.OnDetectCompatibleMsiPackage(string wzPackageId, string wzCompatiblePackageId, long dw64CompatiblePackageVersion, ref bool fCancel)
1190
+ int IBootstrapperApplication.OnDetectCompatibleMsiPackage(string wzPackageId, string wzCompatiblePackageId, string wzCompatiblePackageVersion, ref bool fCancel)
1191
{
1192
- DetectCompatibleMsiPackageEventArgs args = new DetectCompatibleMsiPackageEventArgs(wzPackageId, wzCompatiblePackageId, dw64CompatiblePackageVersion, fCancel);
1192
+ DetectCompatibleMsiPackageEventArgs args = new DetectCompatibleMsiPackageEventArgs(wzPackageId, wzCompatiblePackageId, wzCompatiblePackageVersion, fCancel);
1193
this.OnDetectCompatibleMsiPackage(args);
1194
1195
fCancel = args.Cancel;
1196
return args.HResult;
1197
}
1198
1199
- int IBootstrapperApplication.OnDetectRelatedMsiPackage(string wzPackageId, string wzUpgradeCode, string wzProductCode, bool fPerMachine, long version, RelatedOperation operation, ref bool fCancel)
1199
+ int IBootstrapperApplication.OnDetectRelatedMsiPackage(string wzPackageId, string wzUpgradeCode, string wzProductCode, bool fPerMachine, string wzVersion, RelatedOperation operation, ref bool fCancel)
1200
{
1201
- DetectRelatedMsiPackageEventArgs args = new DetectRelatedMsiPackageEventArgs(wzPackageId, wzUpgradeCode, wzProductCode, fPerMachine, version, operation, fCancel);
1201
+ DetectRelatedMsiPackageEventArgs args = new DetectRelatedMsiPackageEventArgs(wzPackageId, wzUpgradeCode, wzProductCode, fPerMachine, wzVersion, operation, fCancel);
1202
this.OnDetectRelatedMsiPackage(args);
1203
1204
fCancel = args.Cancel;
@@ -1268,9 +1268,9 @@ namespace WixToolset.Mba.Core
1268
return args.HResult;
1269
}
1270
1271
- int IBootstrapperApplication.OnPlanCompatibleMsiPackageBegin(string wzPackageId, string wzCompatiblePackageId, long dw64CompatiblePackageVersion, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
1271
+ int IBootstrapperApplication.OnPlanCompatibleMsiPackageBegin(string wzPackageId, string wzCompatiblePackageId, string wzCompatiblePackageVersion, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
1272
{
1273
- PlanCompatibleMsiPackageBeginEventArgs args = new PlanCompatibleMsiPackageBeginEventArgs(wzPackageId, wzCompatiblePackageId, dw64CompatiblePackageVersion, recommendedState, pRequestedState, fCancel);
1273
+ PlanCompatibleMsiPackageBeginEventArgs args = new PlanCompatibleMsiPackageBeginEventArgs(wzPackageId, wzCompatiblePackageId, wzCompatiblePackageVersion, recommendedState, pRequestedState, fCancel);
1274
this.OnPlanCompatibleMsiPackageBegin(args);
1275
1276
pRequestedState = args.State;
src/WixToolset.Mba.Core/Engine.cs
+74
-12
@@ -178,15 +178,21 @@ namespace WixToolset.Mba.Core
178
}
179
}
180
181
- public Version GetVariableVersion(string name)
181
+ public string GetVariableVersion(string name)
182
{
183
- int ret = this.engine.GetVariableVersion(name, out long value);
184
- if (NativeMethods.S_OK != ret)
183
+ int length;
184
+ IntPtr pUniString = this.getVersionVariable(name, out length);
185
+ try
186
{
186
- throw new Win32Exception(ret);
187
+ return Marshal.PtrToStringUni(pUniString, length);
188
+ }
189
+ finally
190
+ {
191
+ if (IntPtr.Zero != pUniString)
192
+ {
193
+ Marshal.FreeCoTaskMem(pUniString);
194
+ }
195
}
188
-
189
- return LongToVersion(value);
196
}
197
198
public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments)
@@ -224,12 +230,12 @@ namespace WixToolset.Mba.Core
230
this.engine.SetDownloadSource(packageOrContainerId, payloadId, url, user, password);
231
}
232
227
- public void SetVariable(string name, long value)
233
+ public void SetVariableNumeric(string name, long value)
234
{
235
this.engine.SetVariableNumeric(name, value);
236
}
237
232
- public void SetVariable(string name, SecureString value, bool formatted)
238
+ public void SetVariableString(string name, SecureString value, bool formatted)
239
{
240
IntPtr pValue = Marshal.SecureStringToCoTaskMemUnicode(value);
241
try
@@ -242,7 +248,7 @@ namespace WixToolset.Mba.Core
248
}
249
}
250
245
- public void SetVariable(string name, string value, bool formatted)
251
+ public void SetVariableString(string name, string value, bool formatted)
252
{
253
IntPtr pValue = Marshal.StringToCoTaskMemUni(value);
254
try
@@ -255,10 +261,17 @@ namespace WixToolset.Mba.Core
261
}
262
}
263
258
- public void SetVariable(string name, Version value)
264
+ public void SetVariableVersion(string name, string value)
265
{
260
- long version = VersionToLong(value);
261
- this.engine.SetVariableVersion(name, version);
266
+ IntPtr pValue = Marshal.StringToCoTaskMemUni(value);
267
+ try
268
+ {
269
+ this.engine.SetVariableVersion(name, pValue);
270
+ }
271
+ finally
272
+ {
273
+ Marshal.FreeCoTaskMem(pValue);
274
+ }
275
}
276
277
public int SendEmbeddedError(int errorCode, string message, int uiHint)
@@ -329,6 +342,55 @@ namespace WixToolset.Mba.Core
342
}
343
}
344
345
+ /// <summary>
346
+ /// Gets the variable given by <paramref name="name"/> as a version string.
347
+ /// </summary>
348
+ /// <param name="name">The name of the variable to get.</param>
349
+ /// <param name="length">The length of the Unicode string.</param>
350
+ /// <returns>The value by a pointer to a Unicode string. Must be freed by Marshal.FreeCoTaskMem.</returns>
351
+ /// <exception cref="Exception">An error occurred getting the variable.</exception>
352
+ internal IntPtr getVersionVariable(string name, out int length)
353
+ {
354
+ int capacity = InitialBufferSize;
355
+ bool success = false;
356
+ IntPtr pValue = Marshal.AllocCoTaskMem(capacity * UnicodeEncoding.CharSize);
357
+ try
358
+ {
359
+ // Get the size of the buffer.
360
+ int ret = this.engine.GetVariableVersion(name, pValue, ref capacity);
361
+ if (NativeMethods.E_INSUFFICIENT_BUFFER == ret || NativeMethods.E_MOREDATA == ret)
362
+ {
363
+ // Don't need to add 1 for the null terminator, the engine already includes that.
364
+ pValue = Marshal.ReAllocCoTaskMem(pValue, capacity * UnicodeEncoding.CharSize);
365
+ ret = this.engine.GetVariableVersion(name, pValue, ref capacity);
366
+ }
367
+
368
+ if (NativeMethods.S_OK != ret)
369
+ {
370
+ throw Marshal.GetExceptionForHR(ret);
371
+ }
372
+
373
+ // The engine only returns the exact length of the string if the buffer was too small, so calculate it ourselves.
374
+ for (length = 0; length < capacity; ++length)
375
+ {
376
+ if (0 == Marshal.ReadInt16(pValue, length * UnicodeEncoding.CharSize))
377
+ {
378
+ break;
379
+ }
380
+ }
381
+
382
+ success = true;
383
+ return pValue;
384
+ }
385
+ finally
386
+ {
387
+ if (!success && IntPtr.Zero != pValue)
388
+ {
389
+ Marshal.FreeCoTaskMem(pValue);
390
+ }
391
+ }
392
+ }
393
+
394
/// <summary>
395
/// Initialize a SecureString with the given Unicode string.
396
/// </summary>
src/WixToolset.Mba.Core/EventArgs.cs
+18
-18
@@ -241,14 +241,14 @@ namespace WixToolset.Mba.Core
241
/// <param name="version">The version of the forward compatible bundle detected.</param>
242
/// <param name="cancelRecommendation">The cancel recommendation from the engine.</param>
243
/// <param name="ignoreBundleRecommendation">The ignore recommendation from the engine.</param>
244
- public DetectForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, long version, bool cancelRecommendation, bool ignoreBundleRecommendation)
244
+ public DetectForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool cancelRecommendation, bool ignoreBundleRecommendation)
245
: base(cancelRecommendation)
246
{
247
this.BundleId = bundleId;
248
this.RelationType = relationType;
249
this.BundleTag = bundleTag;
250
this.PerMachine = perMachine;
251
- this.Version = Engine.LongToVersion(version);
251
+ this.Version = version;
252
this.IgnoreBundle = ignoreBundleRecommendation;
253
}
254
@@ -275,7 +275,7 @@ namespace WixToolset.Mba.Core
275
/// <summary>
276
/// Gets the version of the forward compatible bundle detected.
277
/// </summary>
278
- public Version Version { get; private set; }
278
+ public string Version { get; private set; }
279
280
/// <summary>
281
/// Instructs the engine whether to use the forward compatible bundle.
@@ -330,12 +330,12 @@ namespace WixToolset.Mba.Core
330
/// <param name="content">The content of the updated bundle.</param>
331
/// <param name="cancelRecommendation">The recommendation from the engine.</param>
332
/// <param name="stopRecommendation">The recommendation from the engine.</param>
333
- public DetectUpdateEventArgs(string updateLocation, long size, long version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation)
333
+ public DetectUpdateEventArgs(string updateLocation, long size, string version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation)
334
: base(cancelRecommendation)
335
{
336
this.UpdateLocation = updateLocation;
337
this.Size = size;
338
- this.Version = Engine.LongToVersion(version);
338
+ this.Version = version;
339
this.Title = title;
340
this.Summary = summary;
341
this.ContentType = contentType;
@@ -356,7 +356,7 @@ namespace WixToolset.Mba.Core
356
/// <summary>
357
/// Gets the version of the updated bundle.
358
/// </summary>
359
- public Version Version { get; private set; }
359
+ public string Version { get; private set; }
360
361
/// <summary>
362
/// Gets the title of the the updated bundle.
@@ -423,14 +423,14 @@ namespace WixToolset.Mba.Core
423
/// <param name="version">The version of the related bundle detected.</param>
424
/// <param name="operation">The operation that will be taken on the detected bundle.</param>
425
/// <param name="cancelRecommendation">The recommendation from the engine.</param>
426
- public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, long version, RelatedOperation operation, bool cancelRecommendation)
426
+ public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, string version, RelatedOperation operation, bool cancelRecommendation)
427
: base(cancelRecommendation)
428
{
429
this.ProductCode = productCode;
430
this.RelationType = relationType;
431
this.BundleTag = bundleTag;
432
this.PerMachine = perMachine;
433
- this.Version = Engine.LongToVersion(version);
433
+ this.Version = version;
434
this.Operation = operation;
435
}
436
@@ -457,7 +457,7 @@ namespace WixToolset.Mba.Core
457
/// <summary>
458
/// Gets the version of the related bundle detected.
459
/// </summary>
460
- public Version Version { get; private set; }
460
+ public string Version { get; private set; }
461
462
/// <summary>
463
/// Gets the operation that will be taken on the detected bundle.
@@ -501,12 +501,12 @@ namespace WixToolset.Mba.Core
501
/// <param name="compatiblePackageId">The identity of the compatible package that was detected.</param>
502
/// <param name="compatiblePackageVersion">The version of the compatible package that was detected.</param>
503
/// <param name="cancelRecommendation">The recommendation from the engine.</param>
504
- public DetectCompatibleMsiPackageEventArgs(string packageId, string compatiblePackageId, long compatiblePackageVersion, bool cancelRecommendation)
504
+ public DetectCompatibleMsiPackageEventArgs(string packageId, string compatiblePackageId, string compatiblePackageVersion, bool cancelRecommendation)
505
: base(cancelRecommendation)
506
{
507
this.PackageId = packageId;
508
this.CompatiblePackageId = compatiblePackageId;
509
- this.CompatiblePackageVersion = Engine.LongToVersion(compatiblePackageVersion);
509
+ this.CompatiblePackageVersion = compatiblePackageVersion;
510
}
511
512
/// <summary>
@@ -522,7 +522,7 @@ namespace WixToolset.Mba.Core
522
/// <summary>
523
/// Gets the version of the compatible package that was detected.
524
/// </summary>
525
- public Version CompatiblePackageVersion { get; private set; }
525
+ public string CompatiblePackageVersion { get; private set; }
526
}
527
528
/// <summary>
@@ -541,14 +541,14 @@ namespace WixToolset.Mba.Core
541
/// <param name="version">The version of the related package detected.</param>
542
/// <param name="operation">The operation that will be taken on the detected package.</param>
543
/// <param name="cancelRecommendation">The recommendation from the engine.</param>
544
- public DetectRelatedMsiPackageEventArgs(string packageId, string upgradeCode, string productCode, bool perMachine, long version, RelatedOperation operation, bool cancelRecommendation)
544
+ public DetectRelatedMsiPackageEventArgs(string packageId, string upgradeCode, string productCode, bool perMachine, string version, RelatedOperation operation, bool cancelRecommendation)
545
: base(cancelRecommendation)
546
{
547
this.PackageId = packageId;
548
this.UpgradeCode = upgradeCode;
549
this.ProductCode = productCode;
550
this.PerMachine = perMachine;
551
- this.Version = Engine.LongToVersion(version);
551
+ this.Version = version;
552
this.Operation = operation;
553
}
554
@@ -575,7 +575,7 @@ namespace WixToolset.Mba.Core
575
/// <summary>
576
/// Gets the version of the related package detected.
577
/// </summary>
578
- public Version Version { get; private set; }
578
+ public string Version { get; private set; }
579
580
/// <summary>
581
/// Gets the operation that will be taken on the detected package.
@@ -813,12 +813,12 @@ namespace WixToolset.Mba.Core
813
/// <param name="recommendedState">The recommended request state for the compatible package.</param>
814
/// <param name="state">The requested state for the compatible package.</param>
815
/// <param name="cancelRecommendation">The recommendation from the engine.</param>
816
- public PlanCompatibleMsiPackageBeginEventArgs(string packageId, string compatiblePackageId, long compatiblePackageVersion, RequestState recommendedState, RequestState state, bool cancelRecommendation)
816
+ public PlanCompatibleMsiPackageBeginEventArgs(string packageId, string compatiblePackageId, string compatiblePackageVersion, RequestState recommendedState, RequestState state, bool cancelRecommendation)
817
: base(cancelRecommendation)
818
{
819
this.PackageId = packageId;
820
this.CompatiblePackageId = compatiblePackageId;
821
- this.CompatiblePackageVersion = Engine.LongToVersion(compatiblePackageVersion);
821
+ this.CompatiblePackageVersion = compatiblePackageVersion;
822
this.RecommendedState = recommendedState;
823
this.State = state;
824
}
@@ -836,7 +836,7 @@ namespace WixToolset.Mba.Core
836
/// <summary>
837
/// Gets the version of the compatible package detected.
838
/// </summary>
839
- public Version CompatiblePackageVersion { get; private set; }
839
+ public string CompatiblePackageVersion { get; private set; }
840
841
/// <summary>
842
/// Gets the recommended state to use for the compatible package for planning.
src/WixToolset.Mba.Core/IBootstrapperApplication.cs
+6
-6
@@ -45,7 +45,7 @@ namespace WixToolset.Mba.Core
45
[MarshalAs(UnmanagedType.U4)] RelationType relationType,
46
[MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
47
[MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
48
- [MarshalAs(UnmanagedType.U8)] long dw64Version,
48
+ [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
49
[MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
50
[MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreBundle
51
);
@@ -63,7 +63,7 @@ namespace WixToolset.Mba.Core
63
int OnDetectUpdate(
64
[MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation,
65
[MarshalAs(UnmanagedType.U8)] long dw64Size,
66
- [MarshalAs(UnmanagedType.U8)] long dw64Version,
66
+ [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
67
[MarshalAs(UnmanagedType.LPWStr)] string wzTitle,
68
[MarshalAs(UnmanagedType.LPWStr)] string wzSummary,
69
[MarshalAs(UnmanagedType.LPWStr)] string wzContentType,
@@ -86,7 +86,7 @@ namespace WixToolset.Mba.Core
86
[MarshalAs(UnmanagedType.U4)] RelationType relationType,
87
[MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
88
[MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
89
- [MarshalAs(UnmanagedType.U8)] long dw64Version,
89
+ [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
90
[MarshalAs(UnmanagedType.U4)] RelatedOperation operation,
91
[MarshalAs(UnmanagedType.Bool)] ref bool fCancel
92
);
@@ -103,7 +103,7 @@ namespace WixToolset.Mba.Core
103
int OnDetectCompatibleMsiPackage(
104
[MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
105
[MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageId,
106
- [MarshalAs(UnmanagedType.U8)] long dw64CompatiblePackageVersion,
106
+ [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageVersion,
107
[MarshalAs(UnmanagedType.Bool)] ref bool fCancel
108
);
109
@@ -114,7 +114,7 @@ namespace WixToolset.Mba.Core
114
[MarshalAs(UnmanagedType.LPWStr)] string wzUpgradeCode,
115
[MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
116
[MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
117
- [MarshalAs(UnmanagedType.U8)] long dw64Version,
117
+ [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
118
[MarshalAs(UnmanagedType.U4)] RelatedOperation operation,
119
[MarshalAs(UnmanagedType.Bool)] ref bool fCancel
120
);
@@ -181,7 +181,7 @@ namespace WixToolset.Mba.Core
181
int OnPlanCompatibleMsiPackageBegin(
182
[MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
183
[MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageId,
184
- [MarshalAs(UnmanagedType.U8)] long dw64CompatiblePackageVersion,
184
+ [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageVersion,
185
[MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
186
[MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
187
[MarshalAs(UnmanagedType.Bool)] ref bool fCancel
src/WixToolset.Mba.Core/IBootstrapperEngine.cs
+3
-2
@@ -36,7 +36,8 @@ namespace WixToolset.Mba.Core
36
[PreserveSig]
37
int GetVariableVersion(
38
[MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
39
- [MarshalAs(UnmanagedType.U8)] out long pqwValue
39
+ IntPtr wzValue,
40
+ [MarshalAs(UnmanagedType.U4)] ref int pcchValue
41
);
42
43
[PreserveSig]
@@ -112,7 +113,7 @@ namespace WixToolset.Mba.Core
113
114
void SetVariableVersion(
115
[MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
115
- [MarshalAs(UnmanagedType.U8)] long qwValue
116
+ IntPtr wzValue
117
);
118
119
void CloseSplashScreen();
src/WixToolset.Mba.Core/IEngine.cs
+6
-13
@@ -96,7 +96,7 @@ namespace WixToolset.Mba.Core
96
/// Gets <see cref="Version"/> variables for the engine.
97
/// </summary>
98
/// <param name="name">The name of the variable.</param>
99
- Version GetVariableVersion(string name);
99
+ string GetVariableVersion(string name);
100
101
/// <summary>
102
/// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
@@ -161,7 +161,7 @@ namespace WixToolset.Mba.Core
161
/// </summary>
162
/// <param name="name">The name of the variable.</param>
163
/// <param name="value">The value to set.</param>
164
- void SetVariable(string name, long value);
164
+ void SetVariableNumeric(string name, long value);
165
166
/// <summary>
167
/// Sets string variables for the engine using SecureStrings.
@@ -169,7 +169,7 @@ namespace WixToolset.Mba.Core
169
/// <param name="name">The name of the variable.</param>
170
/// <param name="value">The value to set.</param>
171
/// <param name="formatted">False if the value is a literal string.</param>
172
- void SetVariable(string name, SecureString value, bool formatted);
172
+ void SetVariableString(string name, SecureString value, bool formatted);
173
174
/// <summary>
175
/// Sets string variables for the engine.
@@ -177,21 +177,14 @@ namespace WixToolset.Mba.Core
177
/// <param name="name">The name of the variable.</param>
178
/// <param name="value">The value to set.</param>
179
/// <param name="formatted">False if the value is a literal string.</param>
180
- void SetVariable(string name, string value, bool formatted);
180
+ void SetVariableString(string name, string value, bool formatted);
181
182
/// <summary>
183
- /// Sets <see cref="Version"/> variables for the engine.
184
- ///
185
- /// The <see cref="Version"/> class can keep track of when the build and revision fields are undefined, but the engine can't.
186
- /// Therefore, the build and revision fields must be defined when setting a <see cref="Version"/> variable.
187
- /// Use the NormalizeVersion method to make sure the engine can accept the Version.
188
- ///
189
- /// To keep track of versions without build or revision fields, use StringVariables instead.
183
+ /// Sets version variables for the engine.
184
/// </summary>
185
/// <param name="name">The name of the variable.</param>
186
/// <param name="value">The value to set.</param>
193
- /// <exception cref="OverflowException">The given <see cref="Version"/> was invalid.</exception>
194
- void SetVariable(string name, Version value);
187
+ void SetVariableVersion(string name, string value);
188
189
/// <summary>
190
/// Sends error message when embedded.
src/WixToolset.Mba.Core/PackageInfo.cs
+2
-2
@@ -159,11 +159,11 @@ namespace WixToolset.Mba.Core
159
}
160
}
161
162
- public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, Version version)
162
+ public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, string version)
163
{
164
PackageInfo package = new PackageInfo();
165
package.Id = id;
166
- package.Version = version.ToString();
166
+ package.Version = version;
167
168
switch (relationType)
169
{
src/balutil/BalBootstrapperEngine.cpp
+8
-6
@@ -133,26 +133,28 @@ public: // IBootstrapperEngine
133
134
virtual STDMETHODIMP GetVariableVersion(
135
__in_z LPCWSTR wzVariable,
136
- __out DWORD64* pqwValue
136
+ __out_ecount_opt(*pcchValue) LPWSTR wzValue,
137
+ __inout DWORD* pcchValue
138
)
139
{
140
HRESULT hr = S_OK;
141
BAENGINE_GETVARIABLEVERSION_ARGS args = { };
142
BAENGINE_GETVARIABLEVERSION_RESULTS results = { };
143
143
- ExitOnNull(pqwValue, hr, E_INVALIDARG, "pqwValue is required");
144
+ ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");
145
146
args.cbSize = sizeof(args);
147
args.wzVariable = wzVariable;
148
149
results.cbSize = sizeof(results);
150
+ results.wzValue = wzValue;
151
+ results.cchValue = *pcchValue;
152
153
hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION, &args, &results, m_pvBAEngineProcContext);
154
152
- *pqwValue = results.qwValue;
155
+ *pcchValue = results.cchValue;
156
157
LExit:
155
- SecureZeroMemory(&results, sizeof(results));
158
return hr;
159
}
160
@@ -410,7 +412,7 @@ public: // IBootstrapperEngine
412
413
virtual STDMETHODIMP SetVariableVersion(
414
__in_z LPCWSTR wzVariable,
413
- __in DWORD64 qwValue
415
+ __in_z_opt LPCWSTR wzValue
416
)
417
{
418
BAENGINE_SETVARIABLEVERSION_ARGS args = { };
@@ -418,7 +420,7 @@ public: // IBootstrapperEngine
420
421
args.cbSize = sizeof(args);
422
args.wzVariable = wzVariable;
421
- args.qwValue = qwValue;
423
+ args.wzValue = wzValue;
424
425
results.cbSize = sizeof(results);
426
src/balutil/balutil.vcxproj
+4
-4
@@ -2,8 +2,8 @@
2
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5
- <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props')" />
6
- <Import Project="..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props')" />
5
+ <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props')" />
6
+ <Import Project="..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" />
7
8
<ItemGroup Label="ProjectConfigurations">
9
<ProjectConfiguration Include="Debug|ARM64">
@@ -98,8 +98,8 @@
98
<PropertyGroup>
99
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
100
</PropertyGroup>
101
- <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props'))" />
102
- <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props'))" />
101
+ <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props'))" />
102
+ <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props'))" />
103
<Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
104
</Target>
105
</Project>
src/balutil/inc/BalBaseBAFunctions.h
+6
-6
@@ -103,7 +103,7 @@ public: // IBootstrapperApplication
103
__in BOOTSTRAPPER_RELATION_TYPE /*relationType*/,
104
__in_z LPCWSTR /*wzBundleTag*/,
105
__in BOOL /*fPerMachine*/,
106
- __in DWORD64 /*dw64Version*/,
106
+ __in LPCWSTR /*wzVersion*/,
107
__inout BOOL* /*pfCancel*/,
108
__inout BOOL* /*pfIgnoreBundle*/
109
)
@@ -123,7 +123,7 @@ public: // IBootstrapperApplication
123
virtual STDMETHODIMP OnDetectUpdate(
124
__in_z LPCWSTR /*wzUpdateLocation*/,
125
__in DWORD64 /*dw64Size*/,
126
- __in DWORD64 /*dw64Version*/,
126
+ __in LPCWSTR /*wzVersion*/,
127
__in_z LPCWSTR /*wzTitle*/,
128
__in_z LPCWSTR /*wzSummary*/,
129
__in_z LPCWSTR /*wzContentType*/,
@@ -148,7 +148,7 @@ public: // IBootstrapperApplication
148
__in BOOTSTRAPPER_RELATION_TYPE /*relationType*/,
149
__in_z LPCWSTR /*wzBundleTag*/,
150
__in BOOL /*fPerMachine*/,
151
- __in DWORD64 /*dw64Version*/,
151
+ __in LPCWSTR /*wzVersion*/,
152
__in BOOTSTRAPPER_RELATED_OPERATION /*operation*/,
153
__inout BOOL* /*pfCancel*/
154
)
@@ -167,7 +167,7 @@ public: // IBootstrapperApplication
167
virtual STDMETHODIMP OnDetectCompatibleMsiPackage(
168
__in_z LPCWSTR /*wzPackageId*/,
169
__in_z LPCWSTR /*wzCompatiblePackageId*/,
170
- __in DWORD64 /*dw64CompatiblePackageVersion*/,
170
+ __in LPCWSTR /*wzCompatiblePackageVersion*/,
171
__inout BOOL* /*pfCancel*/
172
)
173
{
@@ -179,7 +179,7 @@ public: // IBootstrapperApplication
179
__in_z LPCWSTR /*wzUpgradeCode*/,
180
__in_z LPCWSTR /*wzProductCode*/,
181
__in BOOL /*fPerMachine*/,
182
- __in DWORD64 /*dw64Version*/,
182
+ __in LPCWSTR /*wzVersion*/,
183
__in BOOTSTRAPPER_RELATED_OPERATION /*operation*/,
184
__inout BOOL* /*pfCancel*/
185
)
@@ -254,7 +254,7 @@ public: // IBootstrapperApplication
254
virtual STDMETHODIMP OnPlanCompatibleMsiPackageBegin(
255
__in_z LPCWSTR /*wzPackageId*/,
256
__in_z LPCWSTR /*wzCompatiblePackageId*/,
257
- __in DWORD64 /*dw64CompatiblePackageVersion*/,
257
+ __in LPCWSTR /*wzCompatiblePackageVersion*/,
258
__in BOOTSTRAPPER_REQUEST_STATE /*recommendedState*/,
259
__inout BOOTSTRAPPER_REQUEST_STATE* /*pRequestedState*/,
260
__inout BOOL* /*pfCancel*/
src/balutil/inc/BalBaseBootstrapperApplication.h
+6
-6
@@ -101,7 +101,7 @@ public: // IBootstrapperApplication
101
__in BOOTSTRAPPER_RELATION_TYPE /*relationType*/,
102
__in_z LPCWSTR /*wzBundleTag*/,
103
__in BOOL /*fPerMachine*/,
104
- __in DWORD64 /*dw64Version*/,
104
+ __in LPCWSTR /*wzVersion*/,
105
__inout BOOL* pfCancel,
106
__inout BOOL* /*pfIgnoreBundle*/
107
)
@@ -123,7 +123,7 @@ public: // IBootstrapperApplication
123
virtual STDMETHODIMP OnDetectUpdate(
124
__in_z LPCWSTR /*wzUpdateLocation*/,
125
__in DWORD64 /*dw64Size*/,
126
- __in DWORD64 /*dw64Version*/,
126
+ __in LPCWSTR /*wzVersion*/,
127
__in_z LPCWSTR /*wzTitle*/,
128
__in_z LPCWSTR /*wzSummary*/,
129
__in_z LPCWSTR /*wzContentType*/,
@@ -149,7 +149,7 @@ public: // IBootstrapperApplication
149
__in BOOTSTRAPPER_RELATION_TYPE /*relationType*/,
150
__in_z LPCWSTR /*wzBundleTag*/,
151
__in BOOL /*fPerMachine*/,
152
- __in DWORD64 /*dw64Version*/,
152
+ __in LPCWSTR /*wzVersion*/,
153
__in BOOTSTRAPPER_RELATED_OPERATION /*operation*/,
154
__inout BOOL* pfCancel
155
)
@@ -170,7 +170,7 @@ public: // IBootstrapperApplication
170
virtual STDMETHODIMP OnDetectCompatibleMsiPackage(
171
__in_z LPCWSTR /*wzPackageId*/,
172
__in_z LPCWSTR /*wzCompatiblePackageId*/,
173
- __in DWORD64 /*dw64CompatiblePackageVersion*/,
173
+ __in LPCWSTR /*wzCompatiblePackageVersion*/,
174
__inout BOOL* pfCancel
175
)
176
{
@@ -183,7 +183,7 @@ public: // IBootstrapperApplication
183
__in_z LPCWSTR /*wzUpgradeCode*/,
184
__in_z LPCWSTR /*wzProductCode*/,
185
__in BOOL /*fPerMachine*/,
186
- __in DWORD64 /*dw64Version*/,
186
+ __in LPCWSTR /*wzVersion*/,
187
__in BOOTSTRAPPER_RELATED_OPERATION /*operation*/,
188
__inout BOOL* pfCancel
189
)
@@ -264,7 +264,7 @@ public: // IBootstrapperApplication
264
virtual STDMETHODIMP OnPlanCompatibleMsiPackageBegin(
265
__in_z LPCWSTR /*wzPackageId*/,
266
__in_z LPCWSTR /*wzCompatiblePackageId*/,
267
- __in DWORD64 /*dw64CompatiblePackageVersion*/,
267
+ __in LPCWSTR /*wzCompatiblePackageVersion*/,
268
__in BOOTSTRAPPER_REQUEST_STATE /*recommendedState*/,
269
__inout BOOTSTRAPPER_REQUEST_STATE* /*pRequestedState*/,
270
__inout BOOL* pfCancel
src/balutil/inc/BalBaseBootstrapperApplicationProc.h
+6
-6
@@ -78,7 +78,7 @@ static HRESULT BalBaseBAProcOnDetectForwardCompatibleBundle(
78
__inout BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
79
)
80
{
81
- return pBA->OnDetectForwardCompatibleBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->dw64Version, &pResults->fCancel, &pResults->fIgnoreBundle);
81
+ return pBA->OnDetectForwardCompatibleBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, &pResults->fCancel, &pResults->fIgnoreBundle);
82
}
83
84
static HRESULT BalBaseBAProcOnDetectUpdateBegin(
@@ -96,7 +96,7 @@ static HRESULT BalBaseBAProcOnDetectUpdate(
96
__inout BA_ONDETECTUPDATE_RESULTS* pResults
97
)
98
{
99
- return pBA->OnDetectUpdate(pArgs->wzUpdateLocation, pArgs->dw64Size, pArgs->dw64Version, pArgs->wzTitle, pArgs->wzSummary, pArgs->wzContentType, pArgs->wzContent, &pResults->fCancel, &pResults->fStopProcessingUpdates);
99
+ return pBA->OnDetectUpdate(pArgs->wzUpdateLocation, pArgs->dw64Size, pArgs->wzVersion, pArgs->wzTitle, pArgs->wzSummary, pArgs->wzContentType, pArgs->wzContent, &pResults->fCancel, &pResults->fStopProcessingUpdates);
100
}
101
102
static HRESULT BalBaseBAProcOnDetectUpdateComplete(
@@ -114,7 +114,7 @@ static HRESULT BalBaseBAProcOnDetectRelatedBundle(
114
__inout BA_ONDETECTRELATEDBUNDLE_RESULTS* pResults
115
)
116
{
117
- return pBA->OnDetectRelatedBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->dw64Version, pArgs->operation, &pResults->fCancel);
117
+ return pBA->OnDetectRelatedBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->operation, &pResults->fCancel);
118
}
119
120
static HRESULT BalBaseBAProcOnDetectPackageBegin(
@@ -132,7 +132,7 @@ static HRESULT BalBaseBAProcOnDetectCompatiblePackage(
132
__inout BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS* pResults
133
)
134
{
135
- return pBA->OnDetectCompatibleMsiPackage(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->dw64CompatiblePackageVersion, &pResults->fCancel);
135
+ return pBA->OnDetectCompatibleMsiPackage(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->wzCompatiblePackageVersion, &pResults->fCancel);
136
}
137
138
static HRESULT BalBaseBAProcOnDetectRelatedMsiPackage(
@@ -141,7 +141,7 @@ static HRESULT BalBaseBAProcOnDetectRelatedMsiPackage(
141
__inout BA_ONDETECTRELATEDMSIPACKAGE_RESULTS* pResults
142
)
143
{
144
- return pBA->OnDetectRelatedMsiPackage(pArgs->wzPackageId, pArgs->wzUpgradeCode, pArgs->wzProductCode, pArgs->fPerMachine, pArgs->dw64Version, pArgs->operation, &pResults->fCancel);
144
+ return pBA->OnDetectRelatedMsiPackage(pArgs->wzPackageId, pArgs->wzUpgradeCode, pArgs->wzProductCode, pArgs->fPerMachine, pArgs->wzVersion, pArgs->operation, &pResults->fCancel);
145
}
146
147
static HRESULT BalBaseBAProcOnDetectTargetMsiPackage(
@@ -195,7 +195,7 @@ static HRESULT BalBaseBAProcOnPlanCompatibleMsiPackageBegin(
195
__inout BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS* pResults
196
)
197
{
198
- return pBA->OnPlanCompatibleMsiPackageBegin(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->dw64CompatiblePackageVersion, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
198
+ return pBA->OnPlanCompatibleMsiPackageBegin(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->wzCompatiblePackageVersion, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
199
}
200
201
static HRESULT BalBaseBAProcOnPlanCompatibleMsiPackageComplete(
src/balutil/inc/IBootstrapperApplication.h
+6
-6
@@ -32,7 +32,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
32
__in BOOTSTRAPPER_RELATION_TYPE relationType,
33
__in_z LPCWSTR wzBundleTag,
34
__in BOOL fPerMachine,
35
- __in DWORD64 dw64Version,
35
+ __in_z LPCWSTR wzVersion,
36
__inout BOOL* pfCancel,
37
__inout BOOL* pfIgnoreBundle
38
) = 0;
@@ -48,7 +48,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
48
STDMETHOD(OnDetectUpdate)(
49
__in_z_opt LPCWSTR wzUpdateLocation,
50
__in DWORD64 dw64Size,
51
- __in DWORD64 dw64Version,
51
+ __in_z LPCWSTR wzVersion,
52
__in_z_opt LPCWSTR wzTitle,
53
__in_z_opt LPCWSTR wzSummary,
54
__in_z_opt LPCWSTR wzContentType,
@@ -69,7 +69,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
69
__in BOOTSTRAPPER_RELATION_TYPE relationType,
70
__in_z LPCWSTR wzBundleTag,
71
__in BOOL fPerMachine,
72
- __in DWORD64 dw64Version,
72
+ __in_z LPCWSTR wzVersion,
73
__in BOOTSTRAPPER_RELATED_OPERATION operation,
74
__inout BOOL* pfCancel
75
) = 0;
@@ -84,7 +84,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
84
STDMETHOD(OnDetectCompatibleMsiPackage)(
85
__in_z LPCWSTR wzPackageId,
86
__in_z LPCWSTR wzCompatiblePackageId,
87
- __in DWORD64 dw64CompatiblePackageVersion,
87
+ __in_z LPCWSTR wzCompatiblePackageVersion,
88
__inout BOOL* pfCancel
89
) = 0;
90
@@ -94,7 +94,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
94
__in_z LPCWSTR wzUpgradeCode,
95
__in_z LPCWSTR wzProductCode,
96
__in BOOL fPerMachine,
97
- __in DWORD64 dw64Version,
97
+ __in_z LPCWSTR wzVersion,
98
__in BOOTSTRAPPER_RELATED_OPERATION operation,
99
__inout BOOL* pfCancel
100
) = 0;
@@ -156,7 +156,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
156
STDMETHOD(OnPlanCompatibleMsiPackageBegin)(
157
__in_z LPCWSTR wzPackageId,
158
__in_z LPCWSTR wzCompatiblePackageId,
159
- __in DWORD64 dw64CompatiblePackageVersion,
159
+ __in_z LPCWSTR wzCompatiblePackageVersion,
160
__in BOOTSTRAPPER_REQUEST_STATE recommendedState,
161
__inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState,
162
__inout BOOL* pfCancel
src/balutil/inc/IBootstrapperEngine.h
+3
-2
@@ -21,7 +21,8 @@ DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-8
21
22
STDMETHOD(GetVariableVersion)(
23
__in_z LPCWSTR wzVariable,
24
- __out DWORD64* pqwValue
24
+ __out_ecount_opt(*pcchValue) LPWSTR wzValue,
25
+ __inout DWORD* pcchValue
26
) = 0;
27
28
STDMETHOD(FormatString)(
@@ -95,7 +96,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-8
96
97
STDMETHOD(SetVariableVersion)(
98
__in_z LPCWSTR wzVariable,
98
- __in DWORD64 qwValue
99
+ __in_z_opt LPCWSTR wzValue
100
) = 0;
101
102
STDMETHOD(CloseSplashScreen)() = 0;
src/balutil/packages.config
+2
-2
@@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
<package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4
- <package id="WixToolset.BootstrapperCore.Native" version="4.0.33" targetFramework="native" />
5
- <package id="WixToolset.DUtil" version="4.0.51" targetFramework="native" />
4
+ <package id="WixToolset.BootstrapperCore.Native" version="4.0.37" targetFramework="native" />
5
+ <package id="WixToolset.DUtil" version="4.0.55" targetFramework="native" />
6
</packages>
\ No newline at end of file
src/bextutil/BextBundleExtensionEngine.cpp
+8
-6
@@ -185,26 +185,28 @@ public: // IBundleExtensionEngine
185
186
virtual STDMETHODIMP GetVariableVersion(
187
__in_z LPCWSTR wzVariable,
188
- __out DWORD64* pqwValue
188
+ __out_ecount_opt(*pcchValue) LPWSTR wzValue,
189
+ __inout DWORD* pcchValue
190
)
191
{
192
HRESULT hr = S_OK;
193
BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_ARGS args = { };
194
BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_RESULTS results = { };
195
195
- ExitOnNull(pqwValue, hr, E_INVALIDARG, "pqwValue is required");
196
+ ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");
197
198
args.cbSize = sizeof(args);
199
args.wzVariable = wzVariable;
200
201
results.cbSize = sizeof(results);
202
+ results.wzValue = wzValue;
203
+ results.cchValue = *pcchValue;
204
205
hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLEVERSION, &args, &results, m_pvBundleExtensionEngineProcContext);
206
204
- *pqwValue = results.qwValue;
207
+ *pcchValue = results.cchValue;
208
209
LExit:
207
- SecureZeroMemory(&results, sizeof(results));
210
return hr;
211
}
212
@@ -263,7 +265,7 @@ public: // IBundleExtensionEngine
265
266
virtual STDMETHODIMP SetVariableVersion(
267
__in_z LPCWSTR wzVariable,
266
- __in DWORD64 qwValue
268
+ __in_z_opt LPCWSTR wzValue
269
)
270
{
271
BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS args = { };
@@ -271,7 +273,7 @@ public: // IBundleExtensionEngine
273
274
args.cbSize = sizeof(args);
275
args.wzVariable = wzVariable;
274
- args.qwValue = qwValue;
276
+ args.wzValue = wzValue;
277
278
results.cbSize = sizeof(results);
279
src/bextutil/bextutil.vcxproj
+4
-4
@@ -2,8 +2,8 @@
2
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5
- <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props')" />
6
- <Import Project="..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props')" />
5
+ <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props')" />
6
+ <Import Project="..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" />
7
8
<ItemGroup Label="ProjectConfigurations">
9
<ProjectConfiguration Include="Debug|ARM64">
@@ -87,8 +87,8 @@
87
<PropertyGroup>
88
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
89
</PropertyGroup>
90
- <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props'))" />
91
- <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props'))" />
90
+ <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props'))" />
91
+ <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props'))" />
92
<Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
93
</Target>
94
</Project>
src/bextutil/inc/IBundleExtensionEngine.h
+3
-2
@@ -34,7 +34,8 @@ DECLARE_INTERFACE_IID_(IBundleExtensionEngine, IUnknown, "9D027A39-F6B6-42CC-973
34
35
STDMETHOD(GetVariableVersion)(
36
__in_z LPCWSTR wzVariable,
37
- __out DWORD64* pqwValue
37
+ __out_ecount_opt(*pcchValue) LPWSTR wzValue,
38
+ __inout DWORD* pcchValue
39
) = 0;
40
41
STDMETHOD(Log)(
@@ -55,6 +56,6 @@ DECLARE_INTERFACE_IID_(IBundleExtensionEngine, IUnknown, "9D027A39-F6B6-42CC-973
56
57
STDMETHOD(SetVariableVersion)(
58
__in_z LPCWSTR wzVariable,
58
- __in DWORD64 qwValue
59
+ __in_z_opt LPCWSTR wzValue
60
) = 0;
61
};
src/bextutil/packages.config
+2
-2
@@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
<package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4
- <package id="WixToolset.BootstrapperCore.Native" version="4.0.33" targetFramework="native" />
5
- <package id="WixToolset.DUtil" version="4.0.51" targetFramework="native" />
4
+ <package id="WixToolset.BootstrapperCore.Native" version="4.0.37" targetFramework="native" />
5
+ <package id="WixToolset.DUtil" version="4.0.55" targetFramework="native" />
6
</packages>
\ No newline at end of file
src/mbanative/mbanative.vcxproj
+4
-4
@@ -5,8 +5,8 @@
5
<Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
6
<Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
7
<Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
8
- <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props')" />
9
- <Import Project="..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props')" />
8
+ <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props')" />
9
+ <Import Project="..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" />
10
11
<ItemGroup Label="ProjectConfigurations">
12
<ProjectConfiguration Include="Debug|ARM64">
@@ -94,7 +94,7 @@
94
<Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
95
<Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
96
<Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
97
- <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.33\build\WixToolset.BootstrapperCore.Native.props'))" />
98
- <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.51\build\WixToolset.DUtil.props'))" />
97
+ <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.37\build\WixToolset.BootstrapperCore.Native.props'))" />
98
+ <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props'))" />
99
</Target>
100
</Project>
\ No newline at end of file
src/mbanative/packages.config
+2
-2
@@ -4,6 +4,6 @@
4
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" />
5
<package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" />
6
<package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
7
- <package id="WixToolset.BootstrapperCore.Native" version="4.0.33" targetFramework="native" />
8
- <package id="WixToolset.DUtil" version="4.0.51" targetFramework="native" />
7
+ <package id="WixToolset.BootstrapperCore.Native" version="4.0.37" targetFramework="native" />
8
+ <package id="WixToolset.DUtil" version="4.0.55" targetFramework="native" />
9
</packages>
\ No newline at end of file