Skip to content

Commit f59c3d7

Browse files
committed
fix #281616 : compile for PortableApps.com
1 parent fceeba5 commit f59c3d7

32 files changed

+948
-6
lines changed

.appveyor.yml

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

2828
#environment:
29+
environment:
30+
matrix:
31+
- BUILD_WIN_PORTABLE: OFF
32+
- BUILD_WIN_PORTABLE: ON
2933

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

4047
install:
4148
- 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
@@ -39,6 +39,7 @@ vtest/Thumbnails
3939
vtest/Pictures
4040
.vs
4141
dependencies
42+
MuseScorePortable
4243

4344
# Downloaded files during build process
4445
MuseScore_General.sf3

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ option(COVERAGE "Build with instrumentation to record code coverage." OFF)
150150
option(BUILD_64 "Build 64 bit version of editor" ON)
151151
option(BUILD_AUTOUPDATE "Build with autoupdate support" OFF)
152152
option(BUILD_CRASH_REPORTER "Build with crash reporter" OFF)
153+
option(BUILD_PORTABLEAPPS "Windows build for PortableApps.com" OFF)
153154
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)")
154155
option(BUILD_TELEMETRY_MODULE "Build with telemetry module" ON)
155156
set(TELEMETRY_TRACK_ID "" CACHE STRING "Telemetry track id")
@@ -203,6 +204,10 @@ else (BUILD_64 STREQUAL "ON")
203204
SET (DEPENDENCIES_DIR "${PROJECT_SOURCE_DIR}/dependencies/libx86")
204205
endif (BUILD_64 STREQUAL "ON")
205206

207+
if (BUILD_PORTABLEAPPS STREQUAL "ON")
208+
SET (WIN_PORTABLE 1)
209+
endif (BUILD_PORTABLEAPPS STREQUAL "ON")
210+
206211
#
207212
# Sparkle/WinSparkle routine
208213
#
@@ -216,14 +221,14 @@ if (BUILD_AUTOUPDATE STREQUAL "ON")
216221
set(MAC_APPCAST_URL "https://sparkle.musescore.org/${MSCORE_RELEASE_CHANNEL}/3/macos/appcast.xml")
217222
endif(SPARKLE_FOUND)
218223
elseif (MSVC)
219-
if (NOT MSCORE_UNSTABLE)
224+
if ((NOT MSCORE_UNSTABLE) AND (NOT DEFINED WIN_PORTABLE)) # do not include WinSparkle in unstable and portable builds
220225
include(FindWinSparkle)
221226
add_library(winsparkledll SHARED IMPORTED)
222227
set_target_properties(winsparkledll PROPERTIES IMPORTED_IMPLIB ${WINSPARKLE_LIBRARY})
223228
set(WIN_SPARKLE_ENABLED 1)
224229
set(WIN_SPARKLE_APPCAST_URL "https://sparkle.musescore.org/${MSCORE_RELEASE_CHANNEL}/3/win/appcast${ARCH_TYPE}.xml")
225230
message("Win Sparkle Url: " ${WIN_SPARKLE_APPCAST_URL})
226-
endif (NOT MSCORE_UNSTABLE)
231+
endif ((NOT MSCORE_UNSTABLE) AND (NOT DEFINED WIN_PORTABLE))
227232
else (APPLE)
228233
message("Sparkle is not supported on your system.")
229234
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%/
31.5 KB
Loading

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

0 commit comments

Comments
 (0)