Zinthose
Member
Registered: May 2009
From:
|
CONTRIB: Pre-Compile Prompt Dialog
Prompt Before Compilation
Description
With a simple VBScript dropped on the system path, you can allow your NSIS scripts to prompt prior to compilation. I've found this useful to alert me to packages that require a significant amount of time to compile.
Usage
quote: !system 'MsgBox.vbs "Package will take a long time to compile.\n\nAverage Compilation Time: 54 min 35 sec\n\n\tContinue?" "NSIS Compilation"' = 1
VB Script
Save the following VBScript as "MsgBox.vbs" in a location that is listed in the %PATH%.
quote: 'vbscript
'MsgBox.vbs
Dim Caption 'As String
Dim Prompt 'As String
'** Defaults
Caption = "What do you want to do?"
Prompt = "Proceed?"
'** Apply CmdLine Arguments
If WScript.Arguments.Count => 1 Then _
Prompt = WScript.Arguments.Item(0)
If WScript.Arguments.Count => 2 Then _
Caption = WScript.Arguments.Item(1)
'** Allow Meta characters
Prompt = Replace(Prompt, "\r", vbCr)
Prompt = Replace(Prompt, "\n", vbLf)
Prompt = Replace(Prompt, "\t", vbTab)
'** Display Prompt
WScript.Quit [COLOR=blue]MsgBox(Prompt, 289, Caption)
Quick Link | Report this post to a moderator | IP: Logged
|