Prevent Dev title from showing up on Store builds (#627)
Commit 0722781fc updated the app to use `DevAppName` for the
app's window title when it was a non-official build, based on
the state of `IsStoreBuild`.
Unfortunately, `IsStoreBuild` is a _project_ level variable defined in
[build-app-internal.yaml](https://github.com/microsoft/calculator/blob/0722781fc60565938da42ea252766b30d02e5fb5/build/pipelines/templates/build-app-internal.yaml#L36),
but not a _compile-time_ defined value.
To solve this, we are now defining `IS_STORE_BUILD` in
`Calculator.vcxproj` when `IsStoreBuild='True'`, the same way that
we set `SEND_DIAGNOSTICS` for official builds, and we'll change the
window title based on that new `#define`.
Using this new `#define` can lead us down a slippery slope. We need to
limit the amount of divergent code that we have between dev/official
builds. This should be hopefully one of very few instances where
this value is ever used.
This commit is contained in:
@@ -216,7 +216,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(IsStoreBuild)' == 'True'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/DSEND_DIAGNOSTICS %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/DSEND_DIAGNOSTICS /DIS_STORE_BUILD %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace CalculatorApp
|
||||
|
||||
Loaded += ref new RoutedEventHandler(this, &TitleBar::OnLoaded);
|
||||
Unloaded += ref new RoutedEventHandler(this, &TitleBar::OnUnloaded);
|
||||
#ifdef IsStoreBuild
|
||||
#ifdef IS_STORE_BUILD
|
||||
AppName->Text = AppResourceProvider::GetInstance().GetResourceString(L"AppName");
|
||||
#else
|
||||
AppName->Text = AppResourceProvider::GetInstance().GetResourceString(L"DevAppName");
|
||||
#endif //IsStoreBuild
|
||||
#endif //IS_STORE_BUILD
|
||||
}
|
||||
|
||||
void TitleBar::OnLoaded(_In_ Object ^ /*sender*/, _In_ RoutedEventArgs ^ /*e*/)
|
||||
|
||||
Reference in New Issue
Block a user