外部から呼び出された VBScript を使用して、MSI テーブルからファイルのインストール場所を見つけようとしています。
その vbscript を使用して MSI テーブルから、ファイルの場所のフル パスを解決する方法が見つかりません。
VBscript で「ComponentPath」を試してみました。そのファイルがコンポーネントのキーパスとして設定され、コンポーネントを含む MSI がインストールされている場合、これはファイルの完全なパスに解決されます。
ただし、同じコンポーネントのレジストリがキーパスとして設定されている場合、これはファイルのパスを表示できません。この場合、パスはファイルの場所ではなくレジストリ ハイブに解決されます (例: レジストリ ハイブは、ファイルではなく USERPROFILE コンポーネントのキーパスとして設定され、出力ショーンはキーパスとして設定されているレジストリです)。
VBScript で同じことを実現する関数またはクラスはありますか。私は正しく見えていないか、ここにクエリを配置する前に利用可能なすべてのオプションを使い果たしているようです.
これがコードの特定の部分です。HKCU レジストリと APPDATA ファイルを含む空の MSI が必要です。
Set View_Component = Database.OpenView("SELECT * from `Component`")
View_Component.Execute
Set rec_Component = View_Component.Fetch
Set View_Registry = Database.OpenView("SELECT * from `Registry`")
Do While (rec_Component Is Nothing) = False
ComponentGUID=rec_Component.StringData(2)
ComponentPath = objInstaller.ComponentPath(FnMSIFetch("ProductCode"),ComponentGUID)
If (InStr(1, LCase(ComponentPath),"\appdata\")<>0 Or InStr(1, LCase(ComponentPath),"\application data\")<>0) Then
'MsgBox("Appdata File Possibly Found in "& rec_Component.StringData(1) & " Component)
Flag_AppdataFileIsFound = True
View_Registry.Execute
Set rec_Registry = View_Registry.Fetch
'*The below line checks if the REGISTRY table is empty or not.
Do While (rec_Registry Is Nothing) = False
'*The below line checks if the same component has an entry in registry table, and if that registry is an HKCU one.
If rec_Component.StringData(1) = rec_Registry.StringData(6) And rec_Registry.StringData(2) = "1" Then
'MsgBox("HKCU also present in APPDATA Component")
Flag_AppDataCompHasRegistryKey = True
If rec_Component.StringData(6) = rec_Registry.StringData(1) Then
'MsgBox("HKCU is set as keypath for APPDATA Component")
Flag_HKCUIsKeyPathForAppdataFile = True
Exit Do
Else
Flag_HKCUIsNotKeyPathForAppdataFile = True
End If
Else
Flag_AppDataCompDoesNotHaveRegistryKey = True
'MsgBox("HKCU is not present in APPDATA Component - " & rec_Component.StringData(1))
End If
Set rec_Registry = View_Registry.Fetch
Loop
Else
Flag_AppdataFileIsNotFound = True
End If
Set rec_Component = View_Component.Fetch
Loop