Skip to content

Commit 008ebab

Browse files
committed
fix #281616 : compile for PortableApps.com
1 parent 3d9c900 commit 008ebab

32 files changed

+949
-7
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 "Build for Windows 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

155156
if (BUILD_CRASH_REPORTER)
@@ -188,6 +189,10 @@ else (BUILD_64 STREQUAL "ON")
188189
SET (DEPENDENCIES_DIR "${PROJECT_SOURCE_DIR}/dependencies/libx86")
189190
endif (BUILD_64 STREQUAL "ON")
190191

192+
if (BUILD_PORTABLEAPPS STREQUAL "ON")
193+
SET (WIN_PORTABLE 1)
194+
endif (BUILD_PORTABLEAPPS STREQUAL "ON")
195+
191196
#
192197
# Sparkle/WinSparkle routine
193198
#
@@ -201,14 +206,14 @@ if (BUILD_AUTOUPDATE STREQUAL "ON")
201206
set(MAC_APPCAST_URL "https://sparkle.musescore.org/${MSCORE_RELEASE_CHANNEL}/3/macos/appcast.xml")
202207
endif(SPARKLE_FOUND)
203208
elseif (MSVC)
204-
if (NOT MSCORE_UNSTABLE)
209+
if ((NOT MSCORE_UNSTABLE) AND (NOT DEFINED WIN_PORTABLE)) # do not include WinSparkle in unstable and portable builds
205210
include(FindWinSparkle)
206211
add_library(winsparkledll SHARED IMPORTED)
207212
set_target_properties(winsparkledll PROPERTIES IMPORTED_IMPLIB ${WINSPARKLE_LIBRARY})
208213
set(WIN_SPARKLE_ENABLED 1)
209214
set(WIN_SPARKLE_APPCAST_URL "https://sparkle.musescore.org/${MSCORE_RELEASE_CHANNEL}/3/win/appcast${ARCH_TYPE}.xml")
210215
message("Win Sparkle Url: " ${WIN_SPARKLE_APPCAST_URL})
211-
endif (NOT MSCORE_UNSTABLE)
216+
endif ((NOT MSCORE_UNSTABLE) AND (NOT DEFINED WIN_PORTABLE))
212217
else (APPLE)
213218
message("Sparkle is not supported on your system.")
214219
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)