Wix modify an existing ini file

半城伤御伤魂 提交于 2019-12-01 15:52:49

问题


I was trying to modify an .ini file in Wix

If it does not exists, the msi does not complete....

  1. how do I check for this
  2. I really want to modify it

Yes I looked at other stackoverflow questions/answers and on google

I was trying this...

      <Component Id="TestIni" Guid="*">
        <CreateFolder />

        <IniFile Id="Ini1"
                 Action="createLine"
                 Directory="INSTALLLOCATION"
                 Section="Test"
                 Name="Minimal.ini"
                 Key="TestKey"
                 Value="TestValue" />

        <IniFile Id="Ini2"
                 Action="createLine"
                 Directory="WindowsFolder"
                 Section="Test"
                 Name="Minimal.ini"
                 Key="TestKey"
                 Value="WindowsFolder TestValue" />

      </Component>

回答1:


Use Action="addLine" or Action="addTag" if you want to modify an existing value.




回答2:


You could use the FileSearch element to set a property and then use this property in a condition.



来源:https://stackoverflow.com/questions/16990759/wix-modify-an-existing-ini-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!