這裏是解決方案草案:
自定義操作,以填補性能
<CustomAction Id='SaveCmdLineValueLocation' Property='CMDLINE_LOCATION'
Value='[LOCATION]' Execute='firstSequence' />
<CustomAction Id='SetFromCmdLineValueLocation' Property="EFFECTIVE_LOCATION"
Value='[CMDLINE_LOCATION]' Execute='firstSequence' />
<CustomAction Id='SetFromRegValueLocation' Property="EFFECTIVE_LOCATION"
Value='[REG_LOCATION]' Execute='firstSequence' />
執行序列assignes EFFECTIVE_LOCATION無論是從註冊表或者msiexec命令行:
<InstallExecuteSequence>
<Custom Action='SaveCmdLineValueLocation' Before='AppSearch'>
LOCATION
</Custom>
<Custom Action='SetFromCmdLineValueLocation' After='AppSearch'>
CMDLINE_LOCATION
</Custom>
<Custom Action='SetFromRegValueLocation' After='AppSearch'>
REG_LOCATION AND (NOT CMDLINE_LOCATION)
</Custom>
</InstallExecuteSequence>
屬性聲明:
<!-- Property used on command-line. -->
<Property Id="LOCATION" Secure="yes">
</Property>
<!-- Property used finally with ReadioButtonGroup. It must have Value assigned (required when used with RadioButtonGroup -->
<Property Id="EFFECTIVE_LOCATION" Value="OFFICE" Secure="yes">
</Property>
<!-- Read previous value from registy (from recent installation) -->
<Property Id="REG_LOCATION" Secure="yes">
<RegistrySearch Id="loc" Root="HKLM" Key="SOFTWARE\Company\Product" Type="raw" Name="LOCATION" Win64='yes'>
</RegistrySearch>
</Property>
你應該發佈你的代碼。如果你確實聲明瞭屬性,那麼它將在屬性表中。看起來你可能以某種方式錯誤地宣佈了它。 – PhilDW
否定的。我有財產申報'價值=「東西」' - 然後該軟件包編譯和按預期工作(除了我問的問題)。從屬性聲明中移除Value標記就足夠了,並且你得到ICE34。我想爲屬性賦值是強制性的,與RadioButtonGroup一起使用。這打破了閱讀默認設置。 – macmac
好的 - 我最終使用3個屬性解決了這個問題:一個用於從/註冊表中讀取/存儲永久值,第二個用於在靜默安裝期間從命令行獲取值,以及第三個用於RadioButtonGroup的「有效」值。前兩個屬性沒有分配默認值,而「有效」一個 - 沒有。然後,通過CustomActions,我可以根據命令行和註冊表中的值來設置「有效」屬性。 – macmac