共用方式為


ICEM09

ICEM09 會驗證合併模組安全地處理預先定義的目錄。 它會藉由確認模組中沒有任何元件將目錄安裝到預先定義的系統目錄,例如 “ProgramFilesFolder” 或 “StartMenuFolder”。 相反地,模組應該使用具有唯一名稱的目錄(使用合併模組命名慣例建立),並使用自定義動作來以適當的目標目錄為目標。 此方法可防止模組與最終資料庫中現有的目錄結構發生衝突。 ICEM09 會檢查這項技術運作所需的自定義動作不存在(以便合併工具可以產生它們),或以正確的形式存在(使其如預期般運作)。

無法修正 ICEM09 所報告的警告或錯誤,可能會導致合併模組的用戶端發生問題。 具有 ProgramFilesFolder 等主鍵的目錄數據表數據列通常存在於資料庫中;因此,如果模組中的元件直接安裝到 ProgramFilesFolder 等預先定義的目錄,模組中的目錄專案可能會與已經存在的數據列相衝突。 此條件會要求模組的使用者從模組分割原始程序檔,以符合現有的來源目錄。

結果

ICEM09 會在模組元件將目錄安裝到預先定義的系統目錄時回報錯誤或警告,導致可能的名稱與現有的目錄結構衝突。

ICEM09 會針對包含所顯示資料庫專案的模組張貼下列警告。

Warning: The component 'Component1.<GUID>' installs directly into the pre-defined 
directory 'ProgramFilesFolder'. It is recommended that merge modules alias 
all such directories to unique names.

重新命名合併模組目錄,使其不符合 Windows Installer 屬性,因此是唯一的。 然後將同名的屬性設定為 Windows Installer 目錄的值。 發生目錄解析時,目錄具有相同名稱的屬性,因此目錄的安裝位置是 屬性的值。 檔案會從不同的來源位置移至相同的目標位置。 此程式應該完全移除合併衝突。

Warning: The 'ModuleInstallExecuteSequence' table contains a type 51 action 
(StartMenuFolder.<GUID>) for a pre-defined directory, but this action 
does not have sequence number '1'

如果動作沒有序號 1,它可能無法在序列中儘早合併至目標資料庫,以有效運作。

若要修正此警告,請將序號設定為 1。 請注意,最新的合併工具(但不是某些較舊版本)會在合併時產生這些自定義動作,因此不一定需要在合併模組中明確撰寫動作。

Warning: The 'CustomAction' table contains a type 51 action (MyAppDataFolderAction) 
for a pre-defined directory, but the name is not the same as the target directory. 
Many merge tools will generate duplicate actions."

由於 CustomAction 數據行是 CustomAction 數據表的主鍵,因此某些合併工具可能會產生重複的動作,因為預先撰寫的動作名稱不同。

若要修正此警告,請將動作命名為與目標目錄相同的動作。 請注意,最新的合併工具(但不是某些較舊版本)會在合併時產生這些自定義動作,因此不一定需要在合併模組中明確撰寫動作。

目錄數據表

目錄 Directory_Parent DefaultDir
ProgramFilesFolder Directory1 一個
StartMenuFolder Directory2 B:C
AppDataFolder Directory3 D
MyPicturesFolder Directory4 E

 

元件數據表

元件 目錄
Component1。<GUID> ProgramFilesFolder
Component2。<GUID> StartMenuFolder
Component3。<GUID> AppDataFolder
Component4。<GUID> MyPicturesFolder

 

CustomAction 數據表

CustomAction 類型 目標
StartMenuFolder。<GUID> 51 StartMenuFolder。<GUID> [StartMenuFolder]
MyAppDataFolderAction 51 AppDataFolder。<GUID> [AppDataFolder]

 

ModuleInstallExecuteSequence 數據表

行動 序列 BaseAction 條件
StartMenuFolder。<GUID> 100

 

合併模組 ICE 參考