Visual Studio Installer - Change Application Resource

Basically, I have an application with a resource for the main window title in the Resources.resx file. I bind this to the main name of Windows

Title={Binding Title, FallbackValue='My Generic Title'}

I have 2 installers (one for each of my clients). Here's how I do it right now:

  • Set the title specific to client A.
  • Compile the application.
  • Create an installation file for client A.
  • Set a specific header for client B.
  • Compile the application.
  • Create an installation file for client B.

Is there a way to configure the resource for the particular installer project that I am using? Then, then, change the value to the default value?

+1
source share
1 answer

I think you can do the following:

1) Resources.ClientA Resources.ClientB. ( ), . , :

// assembly for ClientA : 
namespace Resources
{
    public class Class1
    {
        public static string Text { get { return "Client A text"; } }
    }
}

// assembly for ClientB : 
namespace Resources
{
    public class Class1
    {
        public static string Text { get { return "Client B text"; } }
    }
}

2) (csproj) :

<PropertyGroup>
    <ClientToken>ClientA</ClientToken>
</PropertyGroup>

3) :

<ItemGroup>
    <ProjectReference Include="..\Resources.$(ClientToken)\Resources.$(ClientToken).csproj">
        <Name>Resources.$(ClientToken)</Name>
    </ProjectReference>
</ItemGroup>

, ClientToken, , . , , , csproj, , , .

, , .

+2

All Articles