アンインストールで発生する問題の種類と展開方法によっては、スクリプトを作成して展開して、マシン上のキャッシュされたMSIを編集して問題を解決することができます。 C:\ Windows \ Installer \フォルダにあるMSIを繰り返して、自分の製品のものを探すことができます(すべて開き、要約情報などを参照してください)
必要なものを見つけたらあなたが導入した問題(つまり、アンインストールなどでカスタムアクションを無効にする)を修正するためにテーブルを直接変更し、次にアンインストールが呼び出されたときに問題が発生しないようにします。
リソース:サンプルスクリプトを含む
Windows Installer SQL Reference
Windows Installer Automation Interface Reference
、私は、これは内部的に配備されたアプリケーションではないフィックスとして顧客に送ることができる何かが、とその可能性は本当に言うために主であることを指摘すべきです同じことをするバイナリを作成して、バイナリが最初にクリーンアップして以前のアンインストールを削除してから新しいものを削除するか、代わりにバイナリを修正してアンインストールの問題。
Option Explicit
Dim objFS, objShell
Dim objFolder, objFiles, objFile
Dim objInstaller
Dim installerPath, titleToFind
Dim queries
Const msiOpenDatabaseReadOnly = 0
Const msiOpenDatabaseTransact = 1
Set objInstaller = CreateObject("WindowsInstaller.Installer")
Set objShell = CreateObject("WScript.Shell")
installerPath = objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\Installer\"
'Set the title you want to use for comparison
titleToFind = "Sample"
' Define the queries you wish to run against the database if found
queries = Array( "UPDATE `InstallExecuteSequence` SET `Condition` = 'NOT Installed' WHERE `Action` = 'SampleAction'", _
"DELETE FROM `InstallExecuteSequence` WHERE `Action` = 'SampleAction'")
Set objFS = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If (objFS.FolderExists(installerPath)) Then
Set objFolder = objFS.GetFolder(installerPath)
Set objFiles = objFolder.Files
For Each objFile in objFiles
If (StrComp (Right(objFile.Name, 4), ".msi") = 0) Then
If (CheckMSI (installerPath & objFile.Name, titleToFind)) Then
UpdateMSI (installerPath & objFile.name)
Exit For
End If
End If
Next
End If
Set objFS = Nothing
Set objShell = Nothing
Set objFile = Nothing
Set objFiles = Nothing
Set objFolder = Nothing
Set objInstaller = Nothing
' Check if the title in the MSI matches the one you are looking for
Function CheckMSI (msiPath, title)
Dim objDatabase, objSummary
Dim msiTitle
Set objDatabase = objInstaller.OpenDatabase (msiPath, msiOpenDatabaseReadOnly) : CheckError
Set objSummary = objDatabase.SummaryInformation(0)
msiTitle = objSummary.Property(2)
If (StrComp (msiTitle, title) = 0) Then
CheckMSI = true
Else
CheckMSI = false
End If
Set objSummary = Nothing
Set objDatabase = Nothing
End Function
' Loop though the queries specified above and execute them against the MSI
Function UpdateMSI (msiPath)
Dim objDatabase
Dim objView
Dim query
Set objDatabase = objInstaller.OpenDatabase(msiPath, msiOpenDatabaseTransact) : CheckError
For Each query in queries
Set objView = objDatabase.OpenView (query) : CheckError
objView.Execute : CheckError
Next
objDatabase.Commit
Set objView = Nothing
Set objDatabase = Nothing
End Function
Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbLf & errRec.FormatText
End If
Fail message
End Sub
Sub Fail (message)
WScript.Echo message
WScript.Quit 2
End Sub
これを行う方法に関するリンクやリソースはありますか? – Davy8
詳細情報を提供するように更新されました – Trotts