*** empty log message ***

svn path=/trunk/boinc/; revision=4874
This commit is contained in:
Rom Walton 2004-12-17 12:07:06 +00:00
parent 85ea5d8ced
commit dc89f888a4
8 changed files with 187 additions and 41 deletions

View File

@ -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 >

View File

@ -1 +1,2 @@
BOINC
BOINCService

Binary file not shown.

View File

@ -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
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
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
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
Property("SERVICE_USERNAME") = strNewValue
End If
Set oShell = Nothing
Set oRecord = Nothing
Set oNetwork = 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
''

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<SetupPrereq><operatingsystemconditions><operatingsystemcondition PlatformId="1" CSDVersion=""/><operatingsystemcondition MajorVersion="4" MinorVersion="0" PlatformId="2" CSDVersion=""/></operatingsystemconditions><files><file LocalFile="C:\BOINCSRC\Main\boinc\win_build\installerv2\redist\Windows\x86\Win9x\scr56en.exe" CheckSum="A6FED98255C7172F5FFCE0ECE87B1D09" FileSize="0,680408"/></files><execute file="scr56en.exe" cmdlinesilent="/Q"/><properties Id="{03563DAE-42A4-4D7E-A0E5-3602FD4DF745}"/></SetupPrereq>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<SetupPrereq><operatingsystemconditions><operatingsystemcondition MajorVersion="5" MinorVersion="0" PlatformId="2" CSDVersion=""/><operatingsystemcondition MajorVersion="5" MinorVersion="1" PlatformId="2" CSDVersion=""/><operatingsystemcondition MajorVersion="5" MinorVersion="2" PlatformId="2" CSDVersion=""/></operatingsystemconditions><files><file LocalFile="C:\BOINCSRC\Main\boinc\win_build\installerv2\redist\Windows\x86\WinNT\scripten.exe" CheckSum="E7595360F0CAD6EB51B04EE73BD738DF" FileSize="0,676312"/></files><execute file="scr56en.exe" cmdlinesilent="/Q"/><properties Id="{03563DAE-42A4-4D7E-A0E5-3602FD4DF746}"/></SetupPrereq>