Skip to content

Commit a1cf032

Browse files
committed
Added bacK MSI_VERSION
1 parent 69705e2 commit a1cf032

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,27 @@ if(Git_FOUND)
3434
OUTPUT_VARIABLE NGSCOPECLIENT_VERSION
3535
OUTPUT_STRIP_TRAILING_WHITESPACE)
3636
message("Git reports scopehal-apps version ${NGSCOPECLIENT_VERSION}")
37+
38+
39+
execute_process(
40+
COMMAND ${GIT_EXECUTABLE} describe --always --tags --long
41+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
42+
OUTPUT_VARIABLE NGSCOPECLIENT_VERSION_LONG
43+
OUTPUT_STRIP_TRAILING_WHITESPACE)
44+
45+
# Ugly string parsing to make windows build happy
46+
# First path: release candidate tags
47+
if(NGSCOPECLIENT_VERSION_LONG MATCHES "v([0-9]*).([0-9]*)-rc([0-9])-([0-9]*)")
48+
set(MSI_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}.${CMAKE_MATCH_4}")
49+
50+
# Release tags
51+
elseif(NGSCOPECLIENT_VERSION_LONG MATCHES "v([0-9]*).([0-9]*)-([0-9]*)")
52+
set(MSI_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.0.${CMAKE_MATCH_3}")
53+
endif()
54+
3755
else()
3856
set(NGSCOPECLIENT_VERSION "unknown")
57+
set(MSI_VERSION "0.1")
3958
message("Git not detected, scopehal-apps version unknown")
4059
endif()
4160

src/ngscopeclient/wix/ngscopeclient.wxs.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<?define Manufacturer = "Antikernel Labs" ?>
33
<?define Product = "ngscopeclient" ?>
4-
<?define Version = "0.1" ?>
4+
<?define Version = "@MSI_VERSION@" ?>
55
<?define RegKey = "ngscopeclient" ?>
66
<?define DefaultInstallDir = "ngscopeclient" ?>
77
<?define ShortcutTarget = "ngscopeclient.exe" ?>
@@ -15,7 +15,7 @@
1515
<Property Id="ARPURLINFOABOUT" Value="https://www.github.com/azonenberg/scopehal-apps" />
1616
<Property Id="ARPURLUPDATEINFO" Value="https://www.github.com/azonenberg/scopehal-apps" />
1717
<Property Id="ARPNOMODIFY" Value="1" />
18-
<Directory Id="TARGETDIR" Name="SourceDir">
18+
<Directory Id="TARGETDIR" Name="SourceDir">
1919
<Directory Id="ProgramMenuFolder">
2020
<Directory Id="ProgramMenuDir" Name="ngscopeclient">
2121
<Component Id="StartMenuShortcuts" Guid="$(var.Uuid.StartMenuShortcuts)">
@@ -43,7 +43,7 @@
4343
<UIRef Id="WixUI_Custom" />
4444
<Property Id="ALLUSERS" Value="1" />
4545
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
46-
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
46+
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
4747
<UI Id="WixUI_Custom">
4848
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
4949
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />

0 commit comments

Comments
 (0)