diff options
author | Rob Mensching <rob@firegiant.com> | 2020-06-22 23:09:30 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2020-06-23 02:10:31 -0700 |
commit | f18b96045088d6d989e70df19343a99092685e5e (patch) | |
tree | 61e2ba55fe4c0c66fcb811412b89cfbb2f532398 /src | |
parent | 06e86dadb969ad1d337db11956814a1f79bbcd02 (diff) | |
download | wix-f18b96045088d6d989e70df19343a99092685e5e.tar.gz wix-f18b96045088d6d989e70df19343a99092685e5e.tar.bz2 wix-f18b96045088d6d989e70df19343a99092685e5e.zip |
Move CustomAction script inner text to ScriptFile attribute
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | 4 | ||||
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs (renamed from src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs) | 9 | ||||
-rw-r--r-- | src/WixToolset.Core/Compiler.cs | 61 |
3 files changed, 26 insertions, 48 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index da92be69..ea6d49a0 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
@@ -347,9 +347,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
347 | command.Execute(); | 347 | command.Execute(); |
348 | } | 348 | } |
349 | 349 | ||
350 | // Update control text from files on disk. | 350 | // Update tuples that reference text files on disk. |
351 | { | 351 | { |
352 | var command = new UpdateControlTextCommand(this.Messaging, section); | 352 | var command = new UpdateFromTextFilesCommand(this.Messaging, section); |
353 | command.Execute(); | 353 | command.Execute(); |
354 | } | 354 | } |
355 | 355 | ||
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs index 104a3a37..4d09ff6b 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs | |||
@@ -9,9 +9,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
9 | using WixToolset.Data.Tuples; | 9 | using WixToolset.Data.Tuples; |
10 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
11 | 11 | ||
12 | internal class UpdateControlTextCommand | 12 | internal class UpdateFromTextFilesCommand |
13 | { | 13 | { |
14 | public UpdateControlTextCommand(IMessaging messaging, IntermediateSection section) | 14 | public UpdateFromTextFilesCommand(IMessaging messaging, IntermediateSection section) |
15 | { | 15 | { |
16 | this.Messaging = messaging; | 16 | this.Messaging = messaging; |
17 | this.Section = section; | 17 | this.Section = section; |
@@ -32,6 +32,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
32 | { | 32 | { |
33 | control.Text = this.ReadTextFile(control.SourceLineNumbers, control.SourceFile.Path); | 33 | control.Text = this.ReadTextFile(control.SourceLineNumbers, control.SourceFile.Path); |
34 | } | 34 | } |
35 | |||
36 | foreach (var customAction in this.Section.Tuples.OfType<CustomActionTuple>().Where(c => c.ScriptFile != null)) | ||
37 | { | ||
38 | customAction.Target = this.ReadTextFile(customAction.SourceLineNumbers, customAction.ScriptFile.Path); | ||
39 | } | ||
35 | } | 40 | } |
36 | 41 | ||
37 | /// <summary> | 42 | /// <summary> |
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index d6c96b28..358f8844 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
@@ -3134,6 +3134,8 @@ namespace WixToolset.Core | |||
3134 | string target = null; | 3134 | string target = null; |
3135 | var explicitWin64 = false; | 3135 | var explicitWin64 = false; |
3136 | 3136 | ||
3137 | string scriptFile = null; | ||
3138 | |||
3137 | CustomActionSourceType? sourceType = null; | 3139 | CustomActionSourceType? sourceType = null; |
3138 | CustomActionTargetType? targetType = null; | 3140 | CustomActionTargetType? targetType = null; |
3139 | var executionType = CustomActionExecutionType.Immediate; | 3141 | var executionType = CustomActionExecutionType.Immediate; |
@@ -3160,7 +3162,6 @@ namespace WixToolset.Core | |||
3160 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); | 3162 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); |
3161 | } | 3163 | } |
3162 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3164 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
3163 | //sourceBits = MsiInterop.MsidbCustomActionTypeBinaryData; | ||
3164 | sourceType = CustomActionSourceType.Binary; | 3165 | sourceType = CustomActionSourceType.Binary; |
3165 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, source); // add a reference to the appropriate Binary | 3166 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, source); // add a reference to the appropriate Binary |
3166 | break; | 3167 | break; |
@@ -3170,7 +3171,6 @@ namespace WixToolset.Core | |||
3170 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); | 3171 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); |
3171 | } | 3172 | } |
3172 | source = this.Core.CreateDirectoryReferenceFromInlineSyntax(sourceLineNumbers, attrib, null); | 3173 | source = this.Core.CreateDirectoryReferenceFromInlineSyntax(sourceLineNumbers, attrib, null); |
3173 | //sourceBits = MsiInterop.MsidbCustomActionTypeDirectory; | ||
3174 | sourceType = CustomActionSourceType.Directory; | 3174 | sourceType = CustomActionSourceType.Directory; |
3175 | break; | 3175 | break; |
3176 | case "DllEntry": | 3176 | case "DllEntry": |
@@ -3179,7 +3179,6 @@ namespace WixToolset.Core | |||
3179 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); | 3179 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); |
3180 | } | 3180 | } |
3181 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 3181 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
3182 | //targetBits = MsiInterop.MsidbCustomActionTypeDll; | ||
3183 | targetType = CustomActionTargetType.Dll; | 3182 | targetType = CustomActionTargetType.Dll; |
3184 | break; | 3183 | break; |
3185 | case "Error": | 3184 | case "Error": |
@@ -3188,7 +3187,6 @@ namespace WixToolset.Core | |||
3188 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); | 3187 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); |
3189 | } | 3188 | } |
3190 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 3189 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
3191 | //targetBits = MsiInterop.MsidbCustomActionTypeTextData | MsiInterop.MsidbCustomActionTypeSourceFile; | ||
3192 | sourceType = CustomActionSourceType.File; | 3190 | sourceType = CustomActionSourceType.File; |
3193 | targetType = CustomActionTargetType.TextData; | 3191 | targetType = CustomActionTargetType.TextData; |
3194 | 3192 | ||
@@ -3206,7 +3204,6 @@ namespace WixToolset.Core | |||
3206 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); | 3204 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); |
3207 | } | 3205 | } |
3208 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid | 3206 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid |
3209 | //targetBits = MsiInterop.MsidbCustomActionTypeExe; | ||
3210 | targetType = CustomActionTargetType.Exe; | 3207 | targetType = CustomActionTargetType.Exe; |
3211 | break; | 3208 | break; |
3212 | case "Execute": | 3209 | case "Execute": |
@@ -3214,30 +3211,24 @@ namespace WixToolset.Core | |||
3214 | switch (execute) | 3211 | switch (execute) |
3215 | { | 3212 | { |
3216 | case "commit": | 3213 | case "commit": |
3217 | //bits |= MsiInterop.MsidbCustomActionTypeInScript | MsiInterop.MsidbCustomActionTypeCommit; | ||
3218 | executionType = CustomActionExecutionType.Commit; | 3214 | executionType = CustomActionExecutionType.Commit; |
3219 | break; | 3215 | break; |
3220 | case "deferred": | 3216 | case "deferred": |
3221 | //bits |= MsiInterop.MsidbCustomActionTypeInScript; | ||
3222 | executionType = CustomActionExecutionType.Deferred; | 3217 | executionType = CustomActionExecutionType.Deferred; |
3223 | break; | 3218 | break; |
3224 | case "firstSequence": | 3219 | case "firstSequence": |
3225 | //bits |= MsiInterop.MsidbCustomActionTypeFirstSequence; | ||
3226 | executionType = CustomActionExecutionType.FirstSequence; | 3220 | executionType = CustomActionExecutionType.FirstSequence; |
3227 | break; | 3221 | break; |
3228 | case "immediate": | 3222 | case "immediate": |
3229 | executionType = CustomActionExecutionType.Immediate; | 3223 | executionType = CustomActionExecutionType.Immediate; |
3230 | break; | 3224 | break; |
3231 | case "oncePerProcess": | 3225 | case "oncePerProcess": |
3232 | //bits |= MsiInterop.MsidbCustomActionTypeOncePerProcess; | ||
3233 | executionType = CustomActionExecutionType.OncePerProcess; | 3226 | executionType = CustomActionExecutionType.OncePerProcess; |
3234 | break; | 3227 | break; |
3235 | case "rollback": | 3228 | case "rollback": |
3236 | //bits |= MsiInterop.MsidbCustomActionTypeInScript | MsiInterop.MsidbCustomActionTypeRollback; | ||
3237 | executionType = CustomActionExecutionType.Rollback; | 3229 | executionType = CustomActionExecutionType.Rollback; |
3238 | break; | 3230 | break; |
3239 | case "secondSequence": | 3231 | case "secondSequence": |
3240 | //bits |= MsiInterop.MsidbCustomActionTypeClientRepeat; | ||
3241 | executionType = CustomActionExecutionType.ClientRepeat; | 3232 | executionType = CustomActionExecutionType.ClientRepeat; |
3242 | break; | 3233 | break; |
3243 | default: | 3234 | default: |
@@ -3251,23 +3242,14 @@ namespace WixToolset.Core | |||
3251 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); | 3242 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); |
3252 | } | 3243 | } |
3253 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3244 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
3254 | //sourceBits = MsiInterop.MsidbCustomActionTypeSourceFile; | ||
3255 | sourceType = CustomActionSourceType.File; | 3245 | sourceType = CustomActionSourceType.File; |
3256 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, source); // add a reference to the appropriate File | 3246 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, source); // add a reference to the appropriate File |
3257 | break; | 3247 | break; |
3258 | case "HideTarget": | 3248 | case "HideTarget": |
3259 | hidden = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3249 | hidden = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
3260 | //if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
3261 | //{ | ||
3262 | // bits |= MsiInterop.MsidbCustomActionTypeHideTarget; | ||
3263 | //} | ||
3264 | break; | 3250 | break; |
3265 | case "Impersonate": | 3251 | case "Impersonate": |
3266 | impersonate = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3252 | impersonate = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
3267 | //if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
3268 | //{ | ||
3269 | // bits |= MsiInterop.MsidbCustomActionTypeNoImpersonate; | ||
3270 | //} | ||
3271 | break; | 3253 | break; |
3272 | case "JScriptCall": | 3254 | case "JScriptCall": |
3273 | if (null != target) | 3255 | if (null != target) |
@@ -3275,15 +3257,10 @@ namespace WixToolset.Core | |||
3275 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); | 3257 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); |
3276 | } | 3258 | } |
3277 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid | 3259 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid |
3278 | //targetBits = MsiInterop.MsidbCustomActionTypeJScript; | ||
3279 | targetType = CustomActionTargetType.JScript; | 3260 | targetType = CustomActionTargetType.JScript; |
3280 | break; | 3261 | break; |
3281 | case "PatchUninstall": | 3262 | case "PatchUninstall": |
3282 | patchUninstall = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3263 | patchUninstall = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
3283 | //if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
3284 | //{ | ||
3285 | // extendedBits |= MsiInterop.MsidbCustomActionTypePatchUninstall; | ||
3286 | //} | ||
3287 | break; | 3264 | break; |
3288 | case "Property": | 3265 | case "Property": |
3289 | if (null != source) | 3266 | if (null != source) |
@@ -3291,7 +3268,6 @@ namespace WixToolset.Core | |||
3291 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); | 3268 | this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); |
3292 | } | 3269 | } |
3293 | source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 3270 | source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
3294 | //sourceBits = MsiInterop.MsidbCustomActionTypeProperty; | ||
3295 | sourceType = CustomActionSourceType.Property; | 3271 | sourceType = CustomActionSourceType.Property; |
3296 | break; | 3272 | break; |
3297 | case "Return": | 3273 | case "Return": |
@@ -3299,18 +3275,15 @@ namespace WixToolset.Core | |||
3299 | switch (returnValue) | 3275 | switch (returnValue) |
3300 | { | 3276 | { |
3301 | case "asyncNoWait": | 3277 | case "asyncNoWait": |
3302 | //bits |= MsiInterop.MsidbCustomActionTypeAsync | MsiInterop.MsidbCustomActionTypeContinue; | ||
3303 | async = true; | 3278 | async = true; |
3304 | ignoreResult = true; | 3279 | ignoreResult = true; |
3305 | break; | 3280 | break; |
3306 | case "asyncWait": | 3281 | case "asyncWait": |
3307 | //bits |= MsiInterop.MsidbCustomActionTypeAsync; | ||
3308 | async = true; | 3282 | async = true; |
3309 | break; | 3283 | break; |
3310 | case "check": | 3284 | case "check": |
3311 | break; | 3285 | break; |
3312 | case "ignore": | 3286 | case "ignore": |
3313 | //bits |= MsiInterop.MsidbCustomActionTypeContinue; | ||
3314 | ignoreResult = true; | 3287 | ignoreResult = true; |
3315 | break; | 3288 | break; |
3316 | case "": | 3289 | case "": |
@@ -3341,15 +3314,11 @@ namespace WixToolset.Core | |||
3341 | switch (script) | 3314 | switch (script) |
3342 | { | 3315 | { |
3343 | case "jscript": | 3316 | case "jscript": |
3344 | //sourceBits = MsiInterop.MsidbCustomActionTypeDirectory; | ||
3345 | sourceType = CustomActionSourceType.Directory; | 3317 | sourceType = CustomActionSourceType.Directory; |
3346 | //targetBits = MsiInterop.MsidbCustomActionTypeJScript; | ||
3347 | targetType = CustomActionTargetType.JScript; | 3318 | targetType = CustomActionTargetType.JScript; |
3348 | break; | 3319 | break; |
3349 | case "vbscript": | 3320 | case "vbscript": |
3350 | //sourceBits = MsiInterop.MsidbCustomActionTypeDirectory; | ||
3351 | sourceType = CustomActionSourceType.Directory; | 3321 | sourceType = CustomActionSourceType.Directory; |
3352 | //targetBits = MsiInterop.MsidbCustomActionTypeVBScript; | ||
3353 | targetType = CustomActionTargetType.VBScript; | 3322 | targetType = CustomActionTargetType.VBScript; |
3354 | break; | 3323 | break; |
3355 | case "": | 3324 | case "": |
@@ -3359,15 +3328,14 @@ namespace WixToolset.Core | |||
3359 | break; | 3328 | break; |
3360 | } | 3329 | } |
3361 | break; | 3330 | break; |
3331 | case "ScriptFile": | ||
3332 | scriptFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
3333 | break; | ||
3362 | case "SuppressModularization": | 3334 | case "SuppressModularization": |
3363 | suppressModularization = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3335 | suppressModularization = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
3364 | break; | 3336 | break; |
3365 | case "TerminalServerAware": | 3337 | case "TerminalServerAware": |
3366 | tsAware = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3338 | tsAware = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
3367 | //if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
3368 | //{ | ||
3369 | // bits |= MsiInterop.MsidbCustomActionTypeTSAware; | ||
3370 | //} | ||
3371 | break; | 3339 | break; |
3372 | case "Value": | 3340 | case "Value": |
3373 | if (null != target) | 3341 | if (null != target) |
@@ -3375,7 +3343,6 @@ namespace WixToolset.Core | |||
3375 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); | 3343 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); |
3376 | } | 3344 | } |
3377 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid | 3345 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid |
3378 | //targetBits = MsiInterop.MsidbCustomActionTypeTextData; | ||
3379 | targetType = CustomActionTargetType.TextData; | 3346 | targetType = CustomActionTargetType.TextData; |
3380 | break; | 3347 | break; |
3381 | case "VBScriptCall": | 3348 | case "VBScriptCall": |
@@ -3384,16 +3351,11 @@ namespace WixToolset.Core | |||
3384 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); | 3351 | this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); |
3385 | } | 3352 | } |
3386 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid | 3353 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid |
3387 | //targetBits = MsiInterop.MsidbCustomActionTypeVBScript; | ||
3388 | targetType = CustomActionTargetType.VBScript; | 3354 | targetType = CustomActionTargetType.VBScript; |
3389 | break; | 3355 | break; |
3390 | case "Win64": | 3356 | case "Win64": |
3391 | explicitWin64 = true; | 3357 | explicitWin64 = true; |
3392 | win64 = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3358 | win64 = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
3393 | //if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
3394 | //{ | ||
3395 | // bits |= MsiInterop.MsidbCustomActionType64BitScript; | ||
3396 | //} | ||
3397 | break; | 3359 | break; |
3398 | default: | 3360 | default: |
3399 | this.Core.UnexpectedAttribute(node, attrib); | 3361 | this.Core.UnexpectedAttribute(node, attrib); |
@@ -3423,7 +3385,12 @@ namespace WixToolset.Core | |||
3423 | // if we have an in-lined Script CustomAction ensure no source or target attributes were provided | 3385 | // if we have an in-lined Script CustomAction ensure no source or target attributes were provided |
3424 | if (inlineScript) | 3386 | if (inlineScript) |
3425 | { | 3387 | { |
3426 | target = innerText; | 3388 | if (String.IsNullOrEmpty(scriptFile)) |
3389 | { | ||
3390 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ScriptFile", "Script")); | ||
3391 | |||
3392 | target = innerText; | ||
3393 | } | ||
3427 | } | 3394 | } |
3428 | else if (CustomActionTargetType.VBScript == targetType) // non-inline vbscript | 3395 | else if (CustomActionTargetType.VBScript == targetType) // non-inline vbscript |
3429 | { | 3396 | { |
@@ -3463,6 +3430,11 @@ namespace WixToolset.Core | |||
3463 | this.Core.Write(ErrorMessages.CustomActionIllegalInnerText(sourceLineNumbers, node.Name.LocalName, innerText, "Script")); | 3430 | this.Core.Write(ErrorMessages.CustomActionIllegalInnerText(sourceLineNumbers, node.Name.LocalName, innerText, "Script")); |
3464 | } | 3431 | } |
3465 | 3432 | ||
3433 | if (!inlineScript && !String.IsNullOrEmpty(scriptFile)) | ||
3434 | { | ||
3435 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ScriptFile", "Script")); | ||
3436 | } | ||
3437 | |||
3466 | if (win64 && CustomActionTargetType.VBScript != targetType && CustomActionTargetType.JScript != targetType) | 3438 | if (win64 && CustomActionTargetType.VBScript != targetType && CustomActionTargetType.JScript != targetType) |
3467 | { | 3439 | { |
3468 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Win64", "Script", "VBScriptCall", "JScriptCall")); | 3440 | this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Win64", "Script", "VBScriptCall", "JScriptCall")); |
@@ -3515,6 +3487,7 @@ namespace WixToolset.Core | |||
3515 | TSAware = tsAware, | 3487 | TSAware = tsAware, |
3516 | Win64 = win64, | 3488 | Win64 = win64, |
3517 | Hidden = hidden, | 3489 | Hidden = hidden, |
3490 | ScriptFile = new IntermediateFieldPathValue { Path = scriptFile } | ||
3518 | }); | 3491 | }); |
3519 | 3492 | ||
3520 | if (YesNoType.Yes == suppressModularization) | 3493 | if (YesNoType.Yes == suppressModularization) |