Skip to content

Commit

Permalink
appveyor.yml: Add FileVersion to the executable and make sure
Browse files Browse the repository at this point in the history
the installer replaces the previous version.

Signed-off-by: Alexandra Trifan <[email protected]>
  • Loading branch information
AlexandraTrifan committed Jan 18, 2018
1 parent 5a6603f commit cf5c282
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 43 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ if (NOT SCOPY_VERSION_GIT)
endif()

# Set .exe properties
set(SCOPY_PRODUCTVERSION_STR ${PROJECT_VERSION})
string(TIMESTAMP BUILD_YEAR "%Y")
if (WIN32)
string(REPLACE "." "," SCOPY_FILEVERSION ${PROJECT_VERSION})
set(SCOPY_PRODUCTVERSION_STR ${PROJECT_VERSION})
string(TIMESTAMP BUILD_YEAR "%Y")
endif()

if (MSVC)
# http://www.suodenjoki.dk/us/archive/2010/min-max.htm
Expand Down Expand Up @@ -163,7 +166,10 @@ qt5_wrap_ui (m2kscope_FORMS_HEADERS ${M2KSCOPE_UIS})
FILE(GLOB M2KSCOPE_RESOURCES resources/*.qrc)
qt5_add_resources(m2kscope_RESOURCES ${M2KSCOPE_RESOURCES})

set(RESOURCES resources/properties.rc)
if (WIN32)
set(RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/resources/properties.rc)
configure_file(properties.rc.cmakein ${RESOURCES} @ONLY)
endif()

add_definitions(-DQT_NO_KEYWORDS)

Expand Down
8 changes: 6 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ install:
build_script:
- set OLD_PATH=%PATH%
- set PATH=C:\msys64\mingw64\bin;%PATH%
- C:\msys64\usr\bin\bash -lc "mkdir /c/build_64 ; cd /c/build_64 ; cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DGIT_EXECUTABLE=/c/Program\\ Files/Git/cmd/git.exe -DPKG_CONFIG_EXECUTABLE=/mingw64/bin/pkg-config.exe -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe /c/projects/scopy && make -j3"
- C:\msys64\usr\bin\bash -lc "mkdir /c/build_64 ; cd /c/build_64 ; cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DGIT_EXECUTABLE=/c/Program\\ Files/Git/cmd/git.exe -DPKG_CONFIG_EXECUTABLE=/mingw64/bin/pkg-config.exe -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe /c/projects/scopy"
- C:\msys64\usr\bin\bash -lc "cd /c/build_64/resources && sed -i 's/^\(FILEVERSION .*\)$/\1,0,"{build}"/' properties.rc"
- C:\msys64\usr\bin\bash -lc "cd /c/build_64 && make -j3"

# Copy the dependencies
- mkdir c:\scopy_64
Expand All @@ -58,7 +60,9 @@ build_script:
- appveyor PushArtifact c:\scopy-64bit.zip

- set PATH=C:\msys64\mingw32\bin;%OLD_PATH%
- C:\msys64\usr\bin\bash -lc "mkdir /c/build_32 ; cd /c/build_32 ; cmake -G 'Unix Makefiles' -DCMAKE_RC_COMPILER=/c/windres.exe -DCMAKE_BUILD_TYPE=Release -DGIT_EXECUTABLE=/c/Program\\ Files/Git/cmd/git.exe -DPKG_CONFIG_EXECUTABLE=/mingw32/bin/pkg-config.exe -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++.exe /c/projects/scopy && make -j3"
- C:\msys64\usr\bin\bash -lc "mkdir /c/build_32 ; cd /c/build_32 ; cmake -G 'Unix Makefiles' -DCMAKE_RC_COMPILER=/c/windres.exe -DCMAKE_BUILD_TYPE=Release -DGIT_EXECUTABLE=/c/Program\\ Files/Git/cmd/git.exe -DPKG_CONFIG_EXECUTABLE=/mingw32/bin/pkg-config.exe -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++.exe /c/projects/scopy"
- C:\msys64\usr\bin\bash -lc "cd /c/build_32/resources && sed -i 's/^\(FILEVERSION .*\)$/\1,0,"{build}"/' properties.rc"
- C:\msys64\usr\bin\bash -lc "cd /c/build_32 && make -j3"

# Copy the dependencies
- mkdir c:\scopy_32
Expand Down
8 changes: 0 additions & 8 deletions config.h.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,5 @@
#define CONFIG_H_CMAKEIN

#define SCOPY_VERSION_GIT "@SCOPY_VERSION_GIT@"
#define SCOPY_PRODUCTVERSION_STR "@SCOPY_PRODUCTVERSION_STR@-g@SCOPY_VERSION_GIT@"
#define SCOPY_COMPANYNAME_STR "Analog Devices"
#define SCOPY_FILEDESCRIPTION_STR "Scopy - A software oscilloscope and signal analysis toolset"
#define SCOPY_INTERNALNAME_STR "Scopy"
#define SCOPY_LEGALCOPYRIGHT_STR "Copyright 2016-@BUILD_YEAR@ ADI and other contributors"
#define SCOPY_LEGALTRADEMARKS_STR "https://www.gnu.org/licenses/gpl-3.0.en.html"
#define SCOPY_PRODUCTNAME_STR "Scopy"
#define SCOPY_ORIGINALFILENAME_STR "scopy.exe"

#endif // CONFIG_H_CMAKEIN
29 changes: 29 additions & 0 deletions properties.rc.cmakein
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <windows.h>
AppIcon ICON DISCARDABLE "@CMAKE_SOURCE_DIR@/resources/icon.ico"

LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT

VS_VERSION_INFO VERSIONINFO
FILEVERSION @SCOPY_FILEVERSION@
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "@SCOPY_PRODUCTVERSION_STR@"
VALUE "CompanyName", "Analog Devices"
VALUE "FileDescription", "Scopy - A software oscilloscope and signal analysis toolset"
VALUE "InternalName", "Scopy"
VALUE "LegalCopyright", "Copyright 2016-@BUILD_YEAR@ ADI and other contributors"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.en.html"
VALUE "OriginalFilename", "scopy.exe"
VALUE "ProductName", "Scopy"
VALUE "ProductVersion", "@SCOPY_PRODUCTVERSION_STR@-g@SCOPY_VERSION_GIT@"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
28 changes: 0 additions & 28 deletions resources/properties.rc

This file was deleted.

4 changes: 2 additions & 2 deletions scopy.iss.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: "c:\scopy_32\*"; DestDir: "{app}"; Check: not Is64BitInstallMode; Flags: recursesubdirs createallsubdirs
Source: "c:\scopy_64\*"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs createallsubdirs
Source: "c:\scopy_32\*"; DestDir: "{app}"; Check: not Is64BitInstallMode; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "c:\scopy_64\*"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Expand Down

0 comments on commit cf5c282

Please sign in to comment.