[wix-users] Error in Light

Habib Salim habib at hsalim.com
Wed Apr 26 10:40:06 PDT 2017


I've tried it both ways - see below
I still get the same error

-----------------------------------------
      <!--<Component Id="cmpAppConfig"
Guid="7C93264D-6DBA-4614-9693-5AC244F30986" KeyPath="yes">
        <File Id="fileAppConfig"
Source="$(var.SourceFilesDir)\$(var.ExeName).config">
          <util:PermissionEx User="Users" Domain="[LOCAL_MACHINE_NAME]"
GenericAll="yes"/>
        </File>
      </Component>-->

      <!--<Component Id="cmpModifyApplicationConfig"
Guid="43E01F65-1C37-49F1-BFD5-D873C349AF65" KeyPath="yes">
        <util:XmlConfig Id="editConnectionString"
                        File="[#fileAppConfig]"
                        Action ="create"
                        On="install"
                        Node="value"
                        Name="connectionString"
                        Value="Data Source=[SERVER_NAME];Initial
Catalog=[DATABASE_NAME];Integrated Security=True"
 
ElementPath="//configuration/connectionStrings/add[\[]@
                        name
='HSalimCo.WpfPivotViews.Properties.Settings.ConnectionString'[\]]/value"
                        Sequence="1"/>
      </Component>-->
      <Component Id="cmpAppConfig"
Guid="7C93264D-6DBA-4614-9693-5AC244F30986" KeyPath="yes">
        <File Id="$(var.ExeName).config"
Source="$(var.SourceFilesDir)\$(var.ExeName).config">
          <util:PermissionEx User="Users" Domain="[LOCAL_MACHINE_NAME]"
GenericAll="yes"/>
        </File>
      </Component>
      <Component Id="cmpModifyApplicationConfig"
Guid="43E01F65-1C37-49F1-BFD5-D873C349AF65" KeyPath="yes">
        <util:XmlConfig Id="editConnectionString"
                        File="[#$(var.ExeName).config]"
                        Action ="create"
                        On="install"
                        Node="value"
                        Name="connectionString"
                        Value="Data Source=[SERVER_NAME];Initial
Catalog=[DATABASE_NAME];Integrated Security=True"
 
ElementPath="//configuration/connectionStrings/add[\[]@
                        name
='HSalimCo.WpfPivotViews.Properties.Settings.ConnectionString'[\]]/value"
                        Sequence="1"/>
      </Component>




-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf
Of Edwin Castro
Sent: Wednesday, April 26, 2017 1:23 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Error in Light

The format suggested, [#$(var.ExeName).config], depends on the File/@Id
for the specific file you are trying to change. I see the component for
$(var.ExeName).config has an Id but the File element does not. That means
the File Id is generated and you don't know it ahead of time. I'd
recommend you explicitly set File/@Id and then use that Id in
XmlConfig/@File. Some thing like this:

      <Component Id="cmpAppConfig"
Guid="7C93264D-6DBA-4614-9693-5AC244F30986" KeyPath="yes">
        <File Id="fileAppConfig" Source
="$(var.SourceFilesDir)\$(var.ExeName).config">
          <util:PermissionEx User="Users" Domain="[LOCAL_MACHINE_NAME]"
GenericAll="yes"/>
        </File>
      </Component>

And then you can set XmlConfig/@File="[#fileAppConfig]".

To use XmlConfig/@File="[#$(var.ExeName).config]" as originally suggested
you would need:

      <Component Id="cmpAppConfig"
Guid="7C93264D-6DBA-4614-9693-5AC244F30986" KeyPath="yes">
        <File Id="$(var.ExeName).config" Source
="$(var.SourceFilesDir)\$(var.ExeName).config">
          <util:PermissionEx User="Users" Domain="[LOCAL_MACHINE_NAME]"
GenericAll="yes"/>
        </File>
      </Component>

--
Edwin G. Castro


On Wed, Apr 26, 2017 at 9:47 AM, Habib Salim <habib at hsalim.com> wrote:
> Thanks for the fast response!
> I tried both
>                         File="[#$(var.ExeName).config]"
>                         File="[INSTALLFOLDER]$(var.ExeName).config"
> I still get the error
>
>
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On 
> Behalf Of Nir Bar
> Sent: Wednesday, April 26, 2017 12:35 PM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: Re: [wix-users] Error in Light
>
> The XmlConfig/@File attribute should be the path to the file on the 
> target system, not on the build machine.Change it to 
> [#$(var.ExeName).config] and it should work.
>
> Nir Bar
> Panel::Software Architecture and Development
>
> ______________________________________________________________
> JetBA.net- Native and WPF WiX BootstrapperApplication Frameworks
>
>
>
>
>
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/


More information about the wix-users mailing list