Skip to content

Commit

Permalink
Enhance: improve PTB differentiation
Browse files Browse the repository at this point in the history
This PR is dependent on #4089 (to provide the `./icon/mudlet.ico` Windows
Icon file).

It adds missing support to the CMake build process for the different
Windows application icons and provides a PTB variant for the installation
screen on Windows (currently the standard Mudlet release version is used
which is a little confusing!). It also adds the Windows PTB `.ico` to the
installer executable (a renamed setup.exe).

It also updates the qmake project file to include the six MacOs and Windows
icon files (`.icns` and `.ico` respectively) in the files that Qt Creator
will be aware of.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
  • Loading branch information
SlySven committed Oct 22, 2020
1 parent 022f31d commit 0fa0103
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
13 changes: 12 additions & 1 deletion CI/appveyor.after_success.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ if ("$Env:APPVEYOR_REPO_TAG" -eq "false" -and -Not $Script:PublicTestBuild) {

$Script:NuSpec = "C:\projects\installers\windows\mudlet.nuspec"
Write-Output "=== Creating Nuget package ==="
# the last change (and the only one in the else branch) can be removed when we
# can arrange for the old value "mudlet_main_512x512_6XS_icon.ico" to be
# replaced in the mudlet/installer repository:
if ($Script:PublicTestBuild) {
# allow public test builds to be installed side by side with the release builds by renaming the app
# no dots in the <id>: https://github.com/Squirrel/Squirrel.Windows/blob/master/docs/using/naming.md
(Get-Content "$Script:NuSpec").replace('<id>Mudlet</id>', '<id>Mudlet-PublicTestBuild</id>') | Set-Content "$Script:NuSpec"
(Get-Content "$Script:NuSpec").replace('<title>Mudlet</title>', '<title>Mudlet (Public Test Build)</title>') | Set-Content "$Script:NuSpec"
(Get-Content "$Script:NuSpec").replace('<iconUrl>https://raw.githubusercontent.com/Mudlet/Mudlet/development/src/icons/mudlet.ico</iconUrl>', '<title>https://raw.githubusercontent.com/Mudlet/Mudlet/development/src/icons/mudlet_ptb.ico</iconUrl>') | Set-Content "$Script:NuSpec"
(Get-Content "$Script:NuSpec").replace('<iconUrl>https://raw.githubusercontent.com/Mudlet/Mudlet/development/src/icons/mudlet_main_512x512_6XS_icon.ico</iconUrl>', '<title>https://raw.githubusercontent.com/Mudlet/Mudlet/development/src/icons/mudlet_ptb.ico</iconUrl>') | Set-Content "$Script:NuSpec"
} else {
(Get-Content "$Script:NuSpec").replace('<iconUrl>https://raw.githubusercontent.com/Mudlet/Mudlet/development/src/icons/mudlet_main_512x512_6XS_icon.ico</iconUrl>', '<title>https://raw.githubusercontent.com/Mudlet/Mudlet/development/src/icons/mudlet.ico</iconUrl>') | Set-Content "$Script:NuSpec"
}
nuget pack "$Script:NuSpec" -Version "$Script:VersionAndSha" -BasePath $SQUIRRELWIN -OutputDirectory $SQUIRRELWIN

Expand All @@ -93,7 +100,11 @@ if ("$Env:APPVEYOR_REPO_TAG" -eq "false" -and -Not $Script:PublicTestBuild) {
}

# fails silently if the nupkg file is not found
.\squirrel.windows\tools\Squirrel --releasify $nupkg_path --releaseDir C:\projects\squirreloutput --loadingGif C:\projects\installers\windows\splash-installing-2x.png --no-msi --setupIcon C:\projects\installers\windows\mudlet_main_48px.ico -n "/a /f C:\projects\installers\windows\code-signing-certificate.p12 /p $Env:signing_password /fd sha256 /tr http://timestamp.digicert.com /td sha256"
if ($Script:PublicTestBuild) {
.\squirrel.windows\tools\Squirrel --releasify $nupkg_path --releaseDir C:\projects\squirreloutput --loadingGif C:\projects\installers\windows\splash-installing-ptb-2x.png --no-msi --setupIcon $Env:APPVEYOR_BUILD_FOLDER\src\icons\mudlet_ptb.ico -n "/a /f C:\projects\installers\windows\code-signing-certificate.p12 /p $Env:signing_password /fd sha256 /tr http://timestamp.digicert.com /td sha256"
} else {
.\squirrel.windows\tools\Squirrel --releasify $nupkg_path --releaseDir C:\projects\squirreloutput --loadingGif C:\projects\installers\windows\splash-installing-2x.png --no-msi --setupIcon $Env:APPVEYOR_BUILD_FOLDER\src\icons\mudlet.ico -n "/a /f C:\projects\installers\windows\code-signing-certificate.p12 /p $Env:signing_password /fd sha256 /tr http://timestamp.digicert.com /td sha256"
}
Write-Output "=== Removing old directory content of release folder ==="
Remove-Item -Recurse -Force $Env:APPVEYOR_BUILD_FOLDER\src\release\*
Write-Output "=== Copying installer over for appveyor ==="
Expand Down
12 changes: 9 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ if(USE_FONTS)
endif()

if(WIN32)
list(APPEND mudlet_RCCS icons/mudlet_main_512x512_6XS_icon.ico)
if(APP_BUILD MATCHES "^-ptb.+")
list(APPEND mudlet_RCCS icons/mudlet_ptb.ico)
elseif((APP_BUILD MATCHES "^-dev.+") OR (APP_BUILD MATCHES "^-test.+"))
list(APPEND mudlet_RCCS icons/mudlet_dev.ico)
else()
list(APPEND mudlet_RCCS icons/mudlet.ico)
endif()
endif()

set(mudlet_SRCS
Expand Down Expand Up @@ -70,6 +76,7 @@ set(mudlet_SRCS
LuaInterface.cpp
main.cpp
mudlet.cpp
MxpTag.cpp
ScriptUnit.cpp
T2DMap.cpp
TAction.cpp
Expand Down Expand Up @@ -110,7 +117,6 @@ set(mudlet_SRCS
TMxpSendTagHandler.cpp
TMxpSoundTagHandler.cpp
TMxpSupportTagHandler.cpp
MxpTag.cpp
TMxpTagHandler.cpp
TMxpTagParser.cpp
TMxpTagProcessor.cpp
Expand Down Expand Up @@ -197,6 +203,7 @@ set(mudlet_HDRS
KeyUnit.h
LuaInterface.h
mudlet.h
MxpTag.h
post_guard.h
pre_guard.h
ScriptUnit.h
Expand Down Expand Up @@ -244,7 +251,6 @@ set(mudlet_HDRS
TMxpNodeBuilder.h
TMxpProcessor.h
TMxpSendTagHandler.h
MxpTag.h
TMxpTagHandler.h
TMxpTagParser.h
TMxpTagProcessor.h
Expand Down
26 changes: 16 additions & 10 deletions src/mudlet.pro
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ win32 {
contains(BUILD, "-dev.+")|contains(BUILD, "-test.+") {
RC_ICONS = icons/mudlet_dev.ico
} else {
RC_ICONS = icons/mudlet_main_512x512_6XS_icon.ico
RC_ICONS = icons/mudlet.ico
}
}

Expand Down Expand Up @@ -1547,8 +1547,6 @@ unix:!macx {


DISTFILES += \
CMakeLists.txt \
.clang-format \
../.github/pr-labeler.yml \
../.github/CODEOWNERS.md \
../.github/CODE_OF_CONDUCT.md \
Expand Down Expand Up @@ -1585,12 +1583,6 @@ DISTFILES += \
../CI/appveyor.set-build-info.ps1 \
../CI/appveyor.functions.ps1 \
../CI/appveyor.build.ps1 \
mudlet-lua/lua/ldoc.css \
mudlet-lua/genDoc.sh \
mudlet-lua/tests/README.md \
mudlet-lua/tests/DB.lua \
mudlet-lua/tests/GUIUtils.lua \
mudlet-lua/tests/Other.lua \
../mudlet.desktop \
../mudlet.png \
../mudlet.svg \
Expand All @@ -1606,4 +1598,18 @@ DISTFILES += \
../CI/copy-non-qt-win-dependencies.ps1 \
../CI/mudlet-deploy-key-windows.ppk \
../CI/qt-silent-install.qs \
../CI/travis.compile.sh
../CI/travis.compile.sh \
.clang-format \
CMakeLists.txt \
icons/mudlet.ico \
icons/mudlet.icns \
icons/mudlet_dev.icns \
icons/mudlet_dev.ico \
icons/mudlet_ptb.icns \
icons/mudlet_ptb.ico \
mudlet-lua/lua/ldoc.css \
mudlet-lua/genDoc.sh \
mudlet-lua/tests/README.md \
mudlet-lua/tests/DB.lua \
mudlet-lua/tests/GUIUtils.lua \
mudlet-lua/tests/Other.lua

0 comments on commit 0fa0103

Please sign in to comment.