home *** CD-ROM | disk | FTP | other *** search
- Const msiNoAction = -1
- Const msiInstallStateAdvertise = 1
- Const msiInstallStateAbsent = 2
- Const msiInstallStateLocal = 3
- Const msiInstallStateSource = 4
- Const msiInstallStateDefault = 5
- Dim nRemoveVBAEN:nRemoveVBAEN = 0
- Dim nRemoveVBACZ:nRemoveVBACZ = 0
- Dim nRemoveVBANL:nRemoveVBAPL = 0
-
- On Error Resume Next
-
-
- If (IsFeatureExists("EN") = 1) Then
- If (Session.Property("ENLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("EN") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAEN") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("English") = msiInstallStateLocal
- Session.FeatureRequestState("WT4ENLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("English") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4ENLANG") = msiInstallStateAbsent
- Session.FeatureRequestState("EN") = msiInstallStateAbsent
- nRemoveVBAEN = 1
- End If
- End If
- If (IsFeatureExists("FR") = 1) Then
- If (Session.Property("FRLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("FR") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAFR") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("French") = msiInstallStateLocal
- Session.FeatureRequestState("WT4FRLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("FR") = msiInstallStateAbsent
- Session.FeatureRequestState("VBAFR") = msiInstallStateAbsent
- Session.FeatureRequestState("French") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4FRLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("DE") = 1) Then
- If (Session.Property("DELANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("DE") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBADE") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("German") = msiInstallStateLocal
- Session.FeatureRequestState("WT4DELANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("DE") = msiInstallStateAbsent
- Session.FeatureRequestState("VBADE") = msiInstallStateAbsent
- Session.FeatureRequestState("German") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4DELANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("JP") = 1) Then
- If (Session.Property("JPLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("JP") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAJP") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Japanese") = msiInstallStateLocal
- Session.FeatureRequestState("WT4JPLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("JP") = msiInstallStateAbsent
- Session.FeatureRequestState("VBAJP") = msiInstallStateAbsent
- Session.FeatureRequestState("Japanese") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4JPLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("IT") = 1) Then
- If (Session.Property("ITLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("IT") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAIT") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Italian") = msiInstallStateLocal
- Session.FeatureRequestState("WT4ITLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("IT") = msiInstallStateAbsent
- Session.FeatureRequestState("VBAIT") = msiInstallStateAbsent
- Session.FeatureRequestState("Italian") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4ITLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("ES") = 1) Then
- If (Session.Property("ESLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("ES") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAES") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Spanish") = msiInstallStateLocal
- Session.FeatureRequestState("WT4ESLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("ES") = msiInstallStateAbsent
- Session.FeatureRequestState("VBAES") = msiInstallStateAbsent
- Session.FeatureRequestState("Spanish") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4ESLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("BP") = 1) Then
- If (Session.Property("BPLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("BP") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBABP") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Portuguese") = msiInstallStateLocal
- Session.FeatureRequestState("WT4BRLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("BP") = msiInstallStateAbsent
- Session.FeatureRequestState("VBABP") = msiInstallStateAbsent
- Session.FeatureRequestState("Portuguese") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4BRLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("CS") = 1) Then
- If (Session.Property("CSLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("CS") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBACS") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("WT4CSLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("CS") = msiInstallStateAbsent
- Session.FeatureRequestState("VBACS") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4CSLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("CT") = 1) Then
- If (Session.Property("CTLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("CT") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBACT") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("WT4CTLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("CT") = msiInstallStateAbsent
- Session.FeatureRequestState("VBACT") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4CTLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("KO") = 1) Then
- If (Session.Property("KOLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("KO") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAKO") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("WT4KRLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("KO") = msiInstallStateAbsent
- Session.FeatureRequestState("VBAKO") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4KRLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("NL") = 1) Then
- If (Session.Property("NLLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("NL") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBANL") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Dutch") = msiInstallStateLocal
- Session.FeatureRequestState("WT4NLLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("NL") = msiInstallStateAbsent
- Session.FeatureRequestState("VBANL") = msiInstallStateAbsent
- Session.FeatureRequestState("Dutch") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4NLLANG") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("PL") = 1) Then
- If (Session.Property("PLLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("PL") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAEN") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Polish") = msiInstallStateLocal
- Session.FeatureRequestState("WT4PLLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("PL") = msiInstallStateAbsent
- Session.FeatureRequestState("Polish") = msiInstallStateAbsent
- nRemoveVBAPL = 1
- End If
- End If
- If (IsFeatureExists("CZ") = 1) Then
- If (Session.Property("CZLANG") = "1") Then
- If (IsFeatureSelected("MainApplications") = True) Then
- Session.FeatureRequestState("CZ") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("VBAProgramFiles") = True) Then
- Session.FeatureRequestState("VBAEN") = msiInstallStateLocal
- End If
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("WT4CZLANG") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("CZ") = msiInstallStateAbsent
- Session.FeatureRequestState("WT4CZLANG") = msiInstallStateAbsent
- nRemoveVBACZ = 1
- End If
- End If
-
- If (nRemoveVBAEN = 1) And (nRemoveVBAPL = 1) And (nRemoveVBACZ = 1) Then
- Session.FeatureRequestState("VBAEN") = msiInstallStateAbsent
- End If
-
- '///////////////////////////////////////////////////////////////////////////
- Function IsFeatureExists(sFeature)
- On Error Resume Next
-
- Dim objDB: Set objDB = Session.Database
-
- Dim sQuery: sQuery = "SELECT * FROM `Feature` WHERE `Feature`.`Feature` = '" & sFeature & "'"
-
- Dim objView: Set objView = objDB.OpenView(sQuery)
- objView.Execute
-
- Dim objRec: Set objRec = objView.Fetch
-
- If (objRec Is Nothing) Then
- ' not there
- IsFeatureExists = 0
- Else
- ' there
- IsFeatureExists = 1
- End If
-
- End Function
-
- '*********************************************************************************************
- ' Function: getFeatureAction(sFeature)
- '
- ' Args: STRING sFeature = `Feature`.`Feature`
- '
- ' Returns: The current install state of the feature
- '
- '*********************************************************************************************
- Function getFeatureState(sFeature)
- On Error Resume Next
- getFeatureState = Session.FeatureCurrentState(sFeature)
- End Function
-
- '*********************************************************************************************
- ' Function: getFeatureAction(sFeature)
- '
- ' Args: STRING sFeature = `Feature`.`Feature`
- '
- ' Returns: The requested action of the feature
- '
- '*********************************************************************************************
- Function getFeatureAction(sFeature)
- On Error Resume Next
- getFeatureAction = Session.FeatureRequestState(sFeature)
- End Function
-
-
- '*********************************************************************************************
- ' Function: IsFeatureSelected(sFeature)
- '
- ' Args: STRING sFeature = `Feature`.`Feature`
- '
- ' Returns: True \ False
- '
- ' Notes: Determines if a feature is selected for install
- '*********************************************************************************************
- Function IsFeatureSelected(sFeature)
- On Error Resume Next
- Dim nState: nState = getFeatureState(sFeature)
- Dim nAction: nAction = getFeatureAction(sFeature)
-
- If ((nAction > msiInstallStateAbsent) Or ((nState > msiInstallStateAbsent) And (nAction = msiNoAction))) Then
- IsFeatureSelected = True
- Else
- IsFeatureSelected = False
- End If
-
- End Function