投稿日 | : 2005/06/07(Tue) 11:44 |
投稿者 | : 魔界の仮面弁士 |
Eメール | : |
URL | : |
タイトル | : Re: インストール先フォルダの取得について |
# 回答ではありません。
> WMIを使用して、Win32_Productクラスで取得できるInstallLocationの値を
> 参照しようかと考えていましたが、いつ取得してもNULLが返ってきてしま
> います。
下記のコードで試してみましたが、Visual Studio Installer で作成されたパッケージでは
InstallLocation が未定義のようですね。
# というよりも、InstallLocation が設定されるのって、VS.NET や Office系ぐらいのようで……。
'Dim WI As WindowsInstaller.Installer
Dim WI As Object
Dim I As Long
Dim P As String
Set WI = CreateObject("WindowsInstaller.Installer")
For I = 0 To WI.Products.Count - 1
P = WI.Products.Item(I)
Debug.Print P & " - " & WI.ProductInfo(P, "InstalledProductName")
Debug.Print " AppPath="; WI.ProductInfo(P, "InstallLocation")
Debug.Print " msiPath="; WI.ProductInfo(P, "InstallSource"); WI.ProductInfo(P, "PackageName")
Next
Set WI = Nothing