Skip to content

Commit

Permalink
test version stamp #GITBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
unitycoder committed Mar 3, 2024
1 parent a31657d commit 9062d8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions UnityLauncherPro/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@
</StackPanel>

<!-- links-->
<Label x:Name="lblVersion" Grid.Row="4" Foreground="{DynamicResource ThemeButtonForeground}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,114,10" Content="" HorizontalContentAlignment="Right"/>
<Button Grid.Row="4" Style="{StaticResource CustomButton}" x:Name="btnOpenGithub" Margin="0,0,15,10" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="BtnOpenGithub_Click">
<Label Content="View in Github" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
</Button>
Expand Down
4 changes: 4 additions & 0 deletions UnityLauncherPro/UnityLauncherPro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<Compile Include="UpgradeWindow.xaml.cs">
<DependentUpon>UpgradeWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Version.cs" />
<Page Include="NewProject.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -189,4 +190,7 @@
<Resource Include="Images\icon.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -Command &quot;$pattern = 'public static string Stamp = \&quot;.*?\&quot;;'; $date = Get-Date -Format 'dd-MM-yyyy HH:mm:ss'; $replacement = 'public static string Stamp = \&quot;' + $date + '\&quot;;'; $path = '$(ProjectDir)Version.cs'; $content = Get-Content $path -Raw; $newContent = $content -replace $pattern, $replacement; [System.IO.File]::WriteAllText($path, $newContent, [System.Text.Encoding]::UTF8)&quot;" />
</Target>
</Project>

0 comments on commit 9062d8d

Please sign in to comment.