Skip to content

Commit 23382cc

Browse files
committed
fix #281616 : compile for PortableApps.com
1 parent 0098c22 commit 23382cc

32 files changed

+904
-11
lines changed

.appveyor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ platform:
2727
- x64
2828

2929
#environment:
30+
environment:
31+
matrix:
32+
- BUILD_WIN_PORTABLE: OFF
33+
- BUILD_WIN_PORTABLE: ON
3034

3135
# build Configuration, i.e. Debug, Release, etc.
3236
configuration: Release
@@ -37,6 +41,9 @@ test: off
3741
matrix:
3842
fast_finish: true # stop all jobs if any job fails
3943
#allow_failures: # list jobs allowed to fail without stopping the rest
44+
exclude:
45+
- platform: x64 # do not build Win64 portable
46+
BUILD_WIN_PORTABLE: ON
4047

4148
install:
4249
- cd %APPVEYOR_BUILD_FOLDER%

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/PortableApps/**/*.ini eol=crlf
2+
build/PortableApps/**/*.txt eol=crlf
3+
build/PortableApps/**/*.ini.in eol=crlf
4+
build/PortableApps/**/*.html eol=crlf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ vtest/Thumbnails
4040
vtest/Pictures
4141
.vs
4242
dependencies
43+
MuseScorePortable
4344

4445
# Downloaded files during build process
4546
MuseScore_General.sf3

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ option(COVERAGE "Build with instrumentation to record code coverage." OFF)
158158
option(BUILD_64 "Build 64 bit version of editor" ON)
159159
option(BUILD_AUTOUPDATE "Build with autoupdate support" OFF)
160160
option(BUILD_CRASH_REPORTER "Build with crash reporter" OFF)
161+
option(BUILD_PORTABLEAPPS "Windows build for PortableApps.com" OFF)
161162
set(CRASH_REPORT_URL "http://127.0.0.1:1127/post" CACHE STRING "URL where to send crash reports (valid if BUILD_CRASH_REPORTER is set to ON)")
162163
option(BUILD_TELEMETRY_MODULE "Build with telemetry module" ON)
163164
set(TELEMETRY_TRACK_ID "" CACHE STRING "Telemetry track id")
@@ -211,6 +212,10 @@ else (BUILD_64 STREQUAL "ON")
211212
SET (DEPENDENCIES_DIR "${PROJECT_SOURCE_DIR}/dependencies/libx86")
212213
endif (BUILD_64 STREQUAL "ON")
213214

215+
if (BUILD_PORTABLEAPPS STREQUAL "ON")
216+
SET (WIN_PORTABLE 1)
217+
endif (BUILD_PORTABLEAPPS STREQUAL "ON")
218+
214219
#
215220
# Sparkle/WinSparkle routine
216221
#
@@ -224,14 +229,14 @@ if (BUILD_AUTOUPDATE STREQUAL "ON")
224229
set(MAC_APPCAST_URL "https://sparkle.musescore.org/${MSCORE_RELEASE_CHANNEL}/3/macos/appcast.xml")
225230
endif(SPARKLE_FOUND)
226231
elseif (MSVC)
227-
if (NOT MSCORE_UNSTABLE)
232+
if ((NOT MSCORE_UNSTABLE) AND (NOT DEFINED WIN_PORTABLE)) # do not include WinSparkle in unstable and portable builds
228233
include(FindWinSparkle)
229234
add_library(winsparkledll SHARED IMPORTED)
230235
set_target_properties(winsparkledll PROPERTIES IMPORTED_IMPLIB ${WINSPARKLE_LIBRARY})
231236
set(WIN_SPARKLE_ENABLED 1)
232237
set(WIN_SPARKLE_APPCAST_URL "https://sparkle.musescore.org/${MSCORE_RELEASE_CHANNEL}/3/win/appcast${ARCH_TYPE}.xml")
233238
message("Win Sparkle Url: " ${WIN_SPARKLE_APPCAST_URL})
234-
endif (NOT MSCORE_UNSTABLE)
239+
endif ((NOT MSCORE_UNSTABLE) AND (NOT DEFINED WIN_PORTABLE))
235240
else (APPLE)
236241
message("Sparkle is not supported on your system.")
237242
endif (APPLE)

assets/mscx-icon.ico

414 KB
Binary file not shown.

assets/mscz-icon.ico

413 KB
Binary file not shown.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[Launch]
2+
ProgramExecutable=MuseScore\bin\MuseScore3.exe
3+
WaitForProgram=true
4+
DirectoryMoveOK=yes
5+
6+
[Activate]
7+
Registry=true
8+
9+
[RegistryKeys]
10+
qtfiledialog=HKCU\Software\QtProject\OrganizationDefaults\FileDialog
11+
qtcustomcolors=HKCU\Software\QtProject\OrganizationDefaults\Qt\customColors
12+
13+
[RegistryCleanupIfEmpty]
14+
1=HKCU\Software\QtProject\OrganizationDefaults\FileDialog
15+
2=HKCU\Software\QtProject\OrganizationDefaults\Qt\customColors
16+
3=HKCU\Software\QtProject\OrganizationDefaults\Qt
17+
4=HKCU\Software\QtProject\OrganizationDefaults
18+
5=HKCU\Software\QtProject
19+
20+
[FileWrite1]
21+
Type=replace
22+
File=%PAL:DataDir%\settings\MuseScore\MuseScore*.ini
23+
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:ForwardSlash%/
24+
Replace=%PAL:Drive%%PAL:PackagePartialDir:ForwardSlash%/
25+
26+
[FileWrite2]
27+
Type=replace
28+
File=%PAL:DataDir%\settings\plugins.xml
29+
Find=<path>%PAL:LastDrive%
30+
Replace=<path>%PAL:Drive%
31+
32+
[FileWrite3]
33+
Type=replace
34+
File=%PAL:DataDir%\settings\plugins.xml
35+
Find=%PAL:LastPackagePartialDir:ForwardSlash%/
36+
Replace=%PAL:PackagePartialDir:ForwardSlash%/
37+
38+
[FileWrite4]
39+
Type=replace
40+
File=%PAL:DataDir%\settings\session
41+
Find=<path>%PAL:LastDrive%
42+
Replace=<path>%PAL:Drive%
43+
44+
[FileWrite5]
45+
Type=replace
46+
File=%PAL:DataDir%\settings\session
47+
Find=%PAL:LastPackagePartialDir:ForwardSlash%/
48+
Replace=%PAL:PackagePartialDir:ForwardSlash%/
49+
50+
[FileWrite6]
51+
Type=replace
52+
File=%PAL:DataDir%\settings\qtfiledialog.reg
53+
Find=file:///%PAL:LastDrive%
54+
Replace=file:///%PAL:Drive%
55+
56+
[FileWrite7]
57+
Type=replace
58+
File=%PAL:DataDir%\settings\qtfiledialog.reg
59+
Find=%PAL:LastPackagePartialDir:ForwardSlash%/
60+
Replace=%PAL:PackagePartialDir:ForwardSlash%/

build/PortableApps/App/readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The files in this directory are necessary for MuseScore Portable to function. There is normally no need to directly access or alter any of the files within these directories.
1.7 KB
Loading
1.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)