@@ -29,17 +29,25 @@ def build_with_sparkle(platform, opts = {})
29
29
end
30
30
31
31
class Builder
32
-
33
32
# if we're using the sandboxed version of Sparkle, then we need to copy the
34
33
# xpc services to the proper folder and sign them. This has to be done
35
34
# before we sign the app itself
36
35
#------------------------------------------------------------------------------
37
36
def codesign_with_sparkle ( config , platform )
38
37
if App . config . embedded_frameworks . any? { |item | item . to_s . include? ( 'Sparkle.framework' ) }
39
38
bundle_path = App . config . app_bundle ( 'MacOSX' )
39
+
40
40
if File . directory? ( App . config . sparkle . sparkle_xpc_path )
41
+ App . info 'Sparkle' , 'Removing unnecessary executables...'
42
+ sparkle_path = File . join ( bundle_path , "Frameworks/Sparkle.framework" )
43
+ [ 'Resources/Autoupdate' , 'Resources/Updater.app' ] . each do |item |
44
+ bundle = File . join ( sparkle_path , item )
45
+ FileUtils . rm_r ( bundle ) if File . exist? ( bundle )
46
+ end
47
+
41
48
xpc_path = File . join ( bundle_path , "XPCServices" )
42
49
App . info 'Sparkle' , "Copying XPCServices to #{ xpc_path } "
50
+
43
51
FileUtils . mkdir_p ( xpc_path )
44
52
`cp -R #{ App . config . sparkle . sparkle_xpc_path } /*.xpc "#{ xpc_path } "`
45
53
@@ -48,12 +56,12 @@ def codesign_with_sparkle(config, platform)
48
56
results = `#{ App . config . sparkle . sparkle_vendor_path } /codesign_xpc "#{ App . config . codesign_certificate } " "#{ File . expand_path ( path ) } " 2>&1`
49
57
end
50
58
end
51
- end
59
+ end
60
+
52
61
codesign_without_sparkle ( config , platform )
53
62
end
54
63
55
64
alias_method "codesign_without_sparkle" , "codesign"
56
65
alias_method "codesign" , "codesign_with_sparkle"
57
66
end
58
-
59
67
end
0 commit comments