diff --git a/checkin_notes b/checkin_notes index 85c3ba9653..b434c06a14 100755 --- a/checkin_notes +++ b/checkin_notes @@ -21452,3 +21452,20 @@ David 16 Dec 2004 lib/ mem_usage.C + +Rom 17 Dec 2004 + - Bug Fix: Windows Scripting host needs to be installed before our setup + can work, so install it. + - Bug Fix: If the SETUPTYPE is Service or ServiceGUI perform validation + on the service account username and password + - Bug Fix: If the service useraccount doesn't already have the + 'Logon As A Service' right grant it. + - Bug Fix: If the SETUPTYPE is Service, install it as a Windows service + under the specified user account + + win_build/installerv2/ + BOINC.ism + win_build/installerv2/redist/windows + BOINC.vbs + + < Added a bunch of files required for various setup things > diff --git a/win_build/installerv2/.cvsignore b/win_build/installerv2/.cvsignore index ae551f94ca..db4844b703 100644 --- a/win_build/installerv2/.cvsignore +++ b/win_build/installerv2/.cvsignore @@ -1 +1,2 @@ -BOINC \ No newline at end of file +BOINC +BOINCService \ No newline at end of file diff --git a/win_build/installerv2/BOINC.ism b/win_build/installerv2/BOINC.ism index e3fe11baea..74ed7cd08d 100644 Binary files a/win_build/installerv2/BOINC.ism and b/win_build/installerv2/BOINC.ism differ diff --git a/win_build/installerv2/redist/Windows/BOINC.vbs b/win_build/installerv2/redist/Windows/BOINC.vbs index de94282907..65d95e493e 100644 --- a/win_build/installerv2/redist/Windows/BOINC.vbs +++ b/win_build/installerv2/redist/Windows/BOINC.vbs @@ -18,6 +18,7 @@ '' '' Contributor(s): '' +Option Explicit Const msiMessageTypeFatalExit = &H00000000 Const msiMessageTypeError = &H01000000 @@ -118,53 +119,45 @@ End Function '' -'' Detect the username of the user executing setup, and populate -'' SERVICE_USERNAME if it is empty +'' Grant the 'Run As A Service' right to the selected account '' -Function DetectUsername() +Function GrantServiceExecutionRight() On Error Resume Next - Dim oNetwork - Dim strValue - Dim strNewValue - Dim strUserName - Dim strUserDomain - Dim strUserComputerName + Dim oShell + Dim oRecord + Dim strCommand + Dim iExitCode - Set oNetwork = CreateObject("WScript.Network") + Set oShell = CreateObject("WScript.Shell") + Set oRecord = Installer.CreateRecord(2) - strValue = Property("SERVICE_USERNAME") - If ( Len(strValue) = 0 ) Then - strUserName = oNetwork.UserName - If ( Err.Number <> 0 ) Then - DetectUsername = msiDoActionStatusFailure - Exit Function - End If - - strUserDomain = oNetwork.UserDomain - If ( Err.Number <> 0 ) Then - DetectUsername = msiDoActionStatusFailure - Exit Function - End If - - strComputerName = oNetwork.ComputerName - If ( Err.Number <> 0 ) Then - DetectUsername = msiDoActionStatusFailure - Exit Function - End If - - If ( strUserDomain = strComputerName ) Then - strNewValue = ".\" & strUserName - Else - strNewValue = strUserDomain & "\" & strUserName - End If - - Property("SERVICE_USERNAME") = strNewValue + strCommand = Property("SOURCEDIR") & "grant.exe add SeServiceLogonRight " & Property("SERVICE_DOMAINUSERNAME") + + iExitCode = oShell.Run(strCommand, 0, true) + If ( iExitCode <> 0 ) Then + oRecord.StringData(0) = "Attempting to execute '[1]' returned with the following exit code '[2]'" + oRecord.StringData(1) = strCommand + oRecord.IntegerData(2) = iExitCode + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + GrantServiceExecutionRight = msiDoActionStatusFailure + Exit Function + Else + If ( Err.Number <> 0 ) Then + oRecord.IntegerData(1) = Err.Number + oRecord.StringData(2) = Err.Description + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + GrantServiceExecutionRight = msiDoActionStatusFailure + Exit Function + End If End If - Set oNetwork = Nothing + Set oShell = Nothing + Set oRecord = Nothing - DetectUsername = msiDoActionStatusSuccess + GrantServiceExecutionRight = msiDoActionStatusSuccess End Function @@ -179,12 +172,20 @@ Function LaunchReadme() Dim strFileToLaunch Set oShell = CreateObject("WScript.Shell") - Set oRecord = Installer.CreateRecord(0) + Set oRecord = Installer.CreateRecord(2) oRecord.StringData(0) = Property("READMEFILETOLAUNCHATEND") strFileToLaunch = "notepad.exe " & FormatRecord(oRecord) oShell.Run(strFileToLaunch) + If ( Err.Number <> 0 ) Then + oRecord.IntegerData(1) = Err.Number + oRecord.StringData(2) = Err.Description + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + LaunchReadme = msiMessageTypeError + Exit Function + End If Set oShell = Nothing Set oRecord = Nothing @@ -193,6 +194,129 @@ Function LaunchReadme() End Function +'' +'' Detect the username of the user executing setup, and populate +'' SERVICE_USERNAME if it is empty +'' +Function PopulateServiceAccount() + On Error Resume Next + + Dim oNetwork + Dim oRecord + Dim strInitialServiceUsername + Dim strInitialServiceDomain + Dim strDomainUsername + Dim strUserName + Dim strUserDomain + + Set oNetwork = CreateObject("WScript.Network") + Set oRecord = Installer.CreateRecord(2) + + strInitialServiceUsername = Property("SERVICE_USERNAME") + If ( Len(strInitialServiceUsername) = 0 ) Then + strUserName = oNetwork.UserName + If ( Err.Number <> 0 ) Then + oRecord.IntegerData(1) = Err.Number + oRecord.StringData(2) = Err.Description + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + PopulateServiceAccount = msiDoActionStatusFailure + Exit Function + End If + End If + + strInitialServiceDomain = Property("SERVICE_DOMAIN") + If ( Len(strInitialServiceDomain) = 0 ) Then + strUserDomain = oNetwork.UserDomain + If ( Err.Number <> 0 ) Then + oRecord.IntegerData(1) = Err.Number + oRecord.StringData(2) = Err.Description + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + PopulateServiceAccount = msiDoActionStatusFailure + Exit Function + End If + End If + + If ( strUserDomain = Property("ComputerName") ) Then + strDomainUsername = ".\" & strUserName + Else + strDomainUsername = strUserDomain & "\" & strUserName + End If + + Property("SERVICE_DOMAINUSERNAME") = strDomainUsername + + Set oNetwork = Nothing + + PopulateServiceAccount = msiDoActionStatusSuccess +End Function + + +'' +'' Validate the service username and domain name being passed +'' into the execution phase +'' +Function ValidateServiceAccount() + On Error Resume Next + + Dim oRecord + Dim strInitialServiceUsername + Dim strInitialServiceDomain + Dim strInitialServiceDomainUsername + Dim strInitialServicePassword + Dim strUsername + Dim strDomain + + Set oRecord = Installer.CreateRecord(2) + + strInitialServicePassword = Property("SERVICE_PASSWORD") + + If ( Len(strInitialServicePassword) = 0 ) Then + oRecord.IntegerData(1) = 25006 + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + ValidateServiceAccount = msiDoActionStatusFailure + Exit Function + End If + + strInitialServiceUsername = Property("SERVICE_USERNAME") + strInitialServiceDomain = Property("SERVICE_DOMAIN") + strInitialServiceDomainUsername = Property("SERVICE_DOMAINUSERNAME") + + If ( Len(strInitialServiceDomainUsername) = 0 ) Then + If ( (Len(strInitialServiceUsername) = 0) Or (Len(strInitialServiceDomain) = 0) ) Then + oRecord.IntegerData(1) = 25007 + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + ValidateServiceAccount = msiDoActionStatusFailure + Exit Function + End If + Else + Property("SERVICE_DOMAIN") = Left( strInitialServiceDomainUsername, InStr( strInitialServiceDomainUsername, "\" ) - 1 ) + If ( Err.Number <> 0 ) Then + oRecord.IntegerData(1) = Err.Number + oRecord.StringData(2) = Err.Description + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + ValidateServiceAccount = msiDoActionStatusFailure + Exit Function + End If + + Property("SERVICE_USERNAME") = Right( strInitialServiceDomainUsername, (Len( strInitialServiceDomainUsername ) - (InStr( strInitialServiceDomainUsername, "\" ))) ) + If ( Err.Number <> 0 ) Then + oRecord.IntegerData(1) = Err.Number + oRecord.StringData(2) = Err.Description + Message msiMessageTypeFatalExit Or vbCritical Or vbOKOnly, oRecord + + ValidateServiceAccount = msiDoActionStatusFailure + Exit Function + End If + End If + + ValidateServiceAccount = msiDoActionStatusSuccess +End Function + + '' '' If we are the 'Shared' SETUPTYPE then we must change ALLUSERS = 1 '' diff --git a/win_build/installerv2/redist/Windows/Windows Scripting Host 5.6 (9x).prq b/win_build/installerv2/redist/Windows/Windows Scripting Host 5.6 (9x).prq new file mode 100644 index 0000000000..8288aa99ac --- /dev/null +++ b/win_build/installerv2/redist/Windows/Windows Scripting Host 5.6 (9x).prq @@ -0,0 +1,2 @@ + + diff --git a/win_build/installerv2/redist/Windows/Windows Scripting Host 5.6 (NT).prq b/win_build/installerv2/redist/Windows/Windows Scripting Host 5.6 (NT).prq new file mode 100644 index 0000000000..0fa49f9f72 --- /dev/null +++ b/win_build/installerv2/redist/Windows/Windows Scripting Host 5.6 (NT).prq @@ -0,0 +1,2 @@ + + diff --git a/win_build/installerv2/redist/Windows/x86/Win9x/scr56en.exe b/win_build/installerv2/redist/Windows/x86/Win9x/scr56en.exe new file mode 100644 index 0000000000..9a7db1a321 Binary files /dev/null and b/win_build/installerv2/redist/Windows/x86/Win9x/scr56en.exe differ diff --git a/win_build/installerv2/redist/Windows/x86/WinNT/scripten.exe b/win_build/installerv2/redist/Windows/x86/WinNT/scripten.exe new file mode 100644 index 0000000000..90d572cfca Binary files /dev/null and b/win_build/installerv2/redist/Windows/x86/WinNT/scripten.exe differ