Instmsi.exe
Instmsi.exe是安裝 Windows Installer 2.0 和舊版 Windows Installer 的可轉散發套件。 如需 Windows Installer 3.0 和更新版本的 可轉散發套件,請參閱 Windows Installer 可轉 散發套件。
如需作業系統隨附哪些 Windows Installer 版本的詳細資訊,請參閱 Windows Installer 的發行版本本。
某些可轉散發套件不應該在特定版本的作業系統上執行。 下表描述哪些 Instmsi 與哪個作業系統相容。
如果Instmsi.exe安裝此版本的 Windows Installer | Instmsi.exe可以在這些作業系統上執行 | Instmsi.exe不得在這些作業系統上執行 |
---|---|---|
Windows Installer 1.0 版 | Windows 95、Windows 98、Windows NT 4.0+SP3 | Windows Me、Windows 2000、Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008 |
Windows Installer 1.1 版 | Windows 95、Windows 98、Windows NT 4.0+SP3 | Windows Me、Windows 2000、Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008 |
Windows Installer 1.2 版 | Windows 95、Windows 98、Windows Me、Windows NT 4.0+SP3 | Windows 2000、Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008 |
Windows Installer 2.0 版 | Windows 95、Windows 98、Windows Me、Windows NT 4.0+SP6、Windows 2000 | Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008 |
例如,轉散發 Windows Installer 1.1 版的應用程式應該在執行可轉散發套件之前,先檢查作業系統是否Windows NT 4.0 SP3 或 Windows 98/95。 使用可轉散發套件的應用程式也應該確保 Windows Installer 的 ANSI 版本已安裝在 Windows 98/95 上,而且 Unicode 版本安裝在 Windows NT 或 Windows 2000 上。 請注意,有些應用程式會將 Unicode 版本重新命名為 InstMsiW。
Syntax
instmsi選項
命令列選項
命令列選項不區分大小寫。
選項 | 描述 |
---|---|
/q | 供轉散發 Windows Installer 作為啟動載入應用程式的一部分的應用程式使用。 使用者不會顯示任何 UI。 啟動載入應用程式應該檢查傳回碼,以判斷是否需要重新開機才能完成 Windows Installer 的安裝。 |
/t | 僅用於偵錯。 |
/c:「msiinst /delayreboot」 | 延遲重新開機選項。 防止 Instmsi 提示使用者重新開機,即使它必須取代安裝期間正在使用的檔案也一樣。 如果使用此選項叫用 Instmsi,如果必須取代正在使用中的檔案,則會傳回ERROR_SUCCESS_REBOOT_REQUIRED。 如果它不需要取代正在使用中的檔案,則會傳回ERROR_SUCCESS。 適用于 Windows Installer 2.0 或更新版本的 Instmsi。 如需延遲重新開機的其他資訊,請參閱一節。 |
/c:「msiinst /delayrebootq」 | 延遲重新開機選項的無訊息版本。 它不會向使用者顯示任何 UI。 否則,行為與上一個選項相同。 適用于 Windows Installer 2.0 或更新版本的 Instmsi。 如需延遲重新開機的其他資訊,請參閱一節。 |
/? | 顯示說明。 |
備註
使用Instmsi.exe安裝 Windows Installer 與另一個應用程式的啟動載入應用程式可能需要額外的系統重新開機。 除了安裝應用程式所需的任何重新開機之外,這也可能是額外的重新開機。
只有在安裝正在使用中檔案的安裝程式應用程式使用 Instmsi.exe 時,才建議使用延遲重新開機選項,讓安裝開發人員消除額外的重新開機。
開發人員應該在其設定應用程式中執行下列動作,以使用延遲重新開機選項。 此選項不適用於安裝早于 2.0 版的視窗安裝程式版本Instmsi.exe版本:
使用延遲重新開機選項
使用其中一個延遲重新開機命令列選項呼叫Instmsi.exe。
將傳回ERROR_SUCCESS或ERROR_SUCCESS_REBOOT_REQUIRED視為成功。
從下列的 InstallerLocation 值取得包含新安裝 Windows Installer 二進位檔的資料夾路徑:
\ HKEY_LOCAL_MACHINE軟體\微軟\窗戶\CurrentVersion\安裝
這個值的類型為 REG_SZ。
將目前目錄設定為步驟 3 中取得的路徑。
在應用程式的套件上叫用 Msiexec,並執行應用程式特定的其他安裝程式程式碼。 如果安裝程式應用程式使用 MsiInstallProduct,則應用程式必須從步驟 3 中取得的位置載入MSI.DLL。
注意
在步驟 3 取得之位置上呼叫 LoadLibrary 的新MSI.DLL的應用程式,必須確定進程內尚未載入舊版的 MSI.DLL。 如果在進程內載入舊版的 MSI.DLL,則必須在載入新MSI.DLL的 LoadLibrary 呼叫之前,先從進程位址空間卸載它。
如果步驟 (5) 不需要重新開機,而且如果步驟 (1) 中的Instmsi.exe傳回ERROR_SUCCESS_REBOOT_REQUIRED,請提示使用者重新開機,以完成系統上的 Windows Installer 二進位檔設定。 不過,如果在步驟 (5) 發生重新開機,則不需要執行其他步驟。
Instmsi.exe適用于 Windows Installer 開發人員的 Windows SDK 元件中提供。
相關主題
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應