Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix message string truncation limit #20

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions chcl3.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Function DisplayLicense()
'line separating paragraphs.
LicenseText = Replace(Replace(Replace(LicenseText, vbCrLf & vbCrLf, "~~~"), vbCrLf, " "), "~~~", vbCrLf & vbCrLf)

LicenseText = LicenseText & vbCrLf & "Click No to exit now or Yes to accept the license." & vbCrLf
DisplayLicense = MsgBox(LicenseText, vbYesNo + vbInformation + vbDefaultButton2, "License Agreement")
LicenseText = LicenseText & vbCrLf & vbCrLf & "Click Cancel to exit now or OK to accept the license." & vbCrLf
DisplayLicense = wso.Popup(LicenseText, 0, "License Agreement", vbOKCancel + vbInformation + vbDefaultButton2)
End Function

Function DisplayWarning
Expand All @@ -67,13 +67,13 @@ Function DisplayWarning
"By proceeding with the use of this script, you accept the license, " & _
"terms and conditions and all associated risks." & vbCrLf & _
vbCrLf & _
"Click No to exit now or Yes to continue." & vbCrLf
"Click Cancel to exit now or OK to continue." & vbCrLf

DisplayWarning = MsgBox(WarningText, vbYesNo + vbExclamation + vbDefaultButton2, "Warning")
DisplayWarning = wso.Popup(WarningText, 0, "Warning", vbOKCancel + vbExclamation + vbDefaultButton2)
End Function

Sub StopService(Service)
WScript.Echo Service(LBound(Service))
'WScript.Echo Service(LBound(Service))
End Sub

Sub StopServices
Expand All @@ -85,20 +85,26 @@ End Sub

Function Main()
Dim Accepted
Accepted = vbYes 'DisplayLicense()
Accepted = DisplayLicense()

If Accepted = vbYes Then
Accepted = vbYes 'DisplayWarning()
If Accepted = vbOK Then
Accepted = DisplayWarning()

If Accepted = vbYes Then
If Accepted = vbOK Then
Call StopServices
End If
End If

Main = 0 ' Report no error
End Function

Sub CleanUp
Set fso = Nothing
Set wso = Nothing
End Sub

ExitCode = Main()
Call CleanUp
WScript.Quit(ExitCode)