Skip to content

Commit d64897e

Browse files
attempt to add macos support
1 parent 3ccf555 commit d64897e

File tree

6 files changed

+219
-5
lines changed

6 files changed

+219
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
os: [ubuntu-latest, windows-latest]
18+
os: [ubuntu-latest, windows-latest, macos-13]
1919

2020
steps:
2121
- name: Checkout repository

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"compile": "electron-webpack",
1111
"dist-64bit": "yarn compile && electron-builder",
1212
"dist-32bit": "yarn compile && electron-builder --ia32",
13-
"dist": "yarn compile && (node -e \"if (process.platform === 'win32') { require('child_process').execSync('npx yarn electron-builder --ia32 --x64', { stdio: 'inherit' }); } else { require('child_process').execSync('electron-builder --linux snap', { stdio: 'inherit' }); }\")",
13+
"dist": "yarn compile && (node -e \"if (process.platform === 'win32') { require('child_process').execSync('npx yarn electron-builder --ia32 --x64', { stdio: 'inherit' }); } else if (process.platform === 'darwin') { require('child_process').execSync('electron-builder --mac', { stdio: 'inherit' }); } else { require('child_process').execSync('electron-builder --linux snap', { stdio: 'inherit' }); }\")",
1414
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null"
1515
},
1616
"dependencies": {
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildMachineOSBuild</key>
6+
<string>16G1314</string>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>en_US</string>
9+
<key>CFBundleExecutable</key>
10+
<string>PepperFlashPlayer</string>
11+
<key>CFBundleGetInfoString</key>
12+
<string>Adobe Flash Player 30.0 d0 Copyright (c) 1996-2018 Adobe Systems Incorporated. All rights reserved</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>com.macromedia.PepperFlashPlayer.pepper</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>PepperFlashPlayer</string>
19+
<key>CFBundlePackageType</key>
20+
<string>BRPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>30.0.0.127</string>
23+
<key>CFBundleSignature</key>
24+
<string>????</string>
25+
<key>CFBundleSupportedPlatforms</key>
26+
<array>
27+
<string>MacOSX</string>
28+
</array>
29+
<key>CFBundleVersion</key>
30+
<string>30.0.0.127</string>
31+
<key>CFPlugInDynamicRegisterFunction</key>
32+
<string></string>
33+
<key>CFPlugInDynamicRegistration</key>
34+
<string>NO</string>
35+
<key>DTCompiler</key>
36+
<string>com.apple.compilers.llvm.clang.1_0</string>
37+
<key>DTPlatformBuild</key>
38+
<string>8B62</string>
39+
<key>DTPlatformVersion</key>
40+
<string>GM</string>
41+
<key>DTSDKBuild</key>
42+
<string>16B2649</string>
43+
<key>DTSDKName</key>
44+
<string>macosx10.12</string>
45+
<key>DTXcode</key>
46+
<string>0810</string>
47+
<key>DTXcodeBuild</key>
48+
<string>8B62</string>
49+
</dict>
50+
</plist>
Binary file not shown.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>files</key>
6+
<dict/>
7+
<key>files2</key>
8+
<dict/>
9+
<key>rules</key>
10+
<dict>
11+
<key>^Resources/</key>
12+
<true/>
13+
<key>^Resources/.*\.lproj/</key>
14+
<dict>
15+
<key>optional</key>
16+
<true/>
17+
<key>weight</key>
18+
<real>1000</real>
19+
</dict>
20+
<key>^Resources/.*\.lproj/locversion.plist$</key>
21+
<dict>
22+
<key>omit</key>
23+
<true/>
24+
<key>weight</key>
25+
<real>1100</real>
26+
</dict>
27+
<key>^version.plist$</key>
28+
<true/>
29+
</dict>
30+
<key>rules2</key>
31+
<dict>
32+
<key>.*\.dSYM($|/)</key>
33+
<dict>
34+
<key>weight</key>
35+
<real>11</real>
36+
</dict>
37+
<key>^(.*/)?\.DS_Store$</key>
38+
<dict>
39+
<key>omit</key>
40+
<true/>
41+
<key>weight</key>
42+
<real>2000</real>
43+
</dict>
44+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
45+
<dict>
46+
<key>nested</key>
47+
<true/>
48+
<key>weight</key>
49+
<real>10</real>
50+
</dict>
51+
<key>^.*</key>
52+
<true/>
53+
<key>^Info\.plist$</key>
54+
<dict>
55+
<key>omit</key>
56+
<true/>
57+
<key>weight</key>
58+
<real>20</real>
59+
</dict>
60+
<key>^PkgInfo$</key>
61+
<dict>
62+
<key>omit</key>
63+
<true/>
64+
<key>weight</key>
65+
<real>20</real>
66+
</dict>
67+
<key>^Resources/</key>
68+
<dict>
69+
<key>weight</key>
70+
<real>20</real>
71+
</dict>
72+
<key>^Resources/.*\.lproj/</key>
73+
<dict>
74+
<key>optional</key>
75+
<true/>
76+
<key>weight</key>
77+
<real>1000</real>
78+
</dict>
79+
<key>^Resources/.*\.lproj/locversion.plist$</key>
80+
<dict>
81+
<key>omit</key>
82+
<true/>
83+
<key>weight</key>
84+
<real>1100</real>
85+
</dict>
86+
<key>^[^/]+$</key>
87+
<dict>
88+
<key>nested</key>
89+
<true/>
90+
<key>weight</key>
91+
<real>10</real>
92+
</dict>
93+
<key>^embedded\.provisionprofile$</key>
94+
<dict>
95+
<key>weight</key>
96+
<real>20</real>
97+
</dict>
98+
<key>^version\.plist$</key>
99+
<dict>
100+
<key>weight</key>
101+
<real>20</real>
102+
</dict>
103+
</dict>
104+
</dict>
105+
</plist>

src/main/index.js

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ switch (process.platform) {
1515
case "linux":
1616
pluginName = process.arch == 'x64' ? 'x64/libpepflashplayer.so' : 'x32/libpepflashplayer.so';
1717
break;
18-
18+
// If macOS, use PepperFlashPlayer.plugin
19+
case "darwin":
20+
pluginName = 'PepperFlashPlayer.plugin';
21+
break;
1922
default:
2023
pluginName = 'x64/pepflashplayer.dll';
2124
break;
@@ -51,7 +54,63 @@ function createWindow() {
5154

5255
}
5356
);
54-
win.setMenu(null);
57+
macosMenu = [
58+
{
59+
label: app.name,
60+
submenu: [
61+
{
62+
label: "About " + app.name,
63+
role: "about"
64+
},
65+
{
66+
type: "separator"
67+
},
68+
{
69+
label: "Quit",
70+
role: "quit"
71+
}
72+
]
73+
},
74+
// Add edit menu for macOS
75+
{
76+
label: "Edit",
77+
submenu: [
78+
{
79+
label: "Undo",
80+
role: "undo"
81+
},
82+
{
83+
label: "Redo",
84+
role: "redo"
85+
},
86+
{
87+
type: "separator"
88+
},
89+
{
90+
label: "Cut",
91+
role: "cut"
92+
},
93+
{
94+
label: "Copy",
95+
role: "copy"
96+
},
97+
{
98+
label: "Paste",
99+
role: "paste"
100+
},
101+
{
102+
label: "Select All",
103+
role: "selectAll"
104+
}
105+
]
106+
}
107+
];
108+
// If not on macOS, disable the menu.
109+
if (process.platform !== "darwin") {
110+
win.setMenu(null);
111+
} else {
112+
win.setMenu(macosMenu);
113+
}
55114
win.maximize();
56115
if(isDev){
57116
win.openDevTools();
@@ -114,7 +173,7 @@ app.whenReady().then(() => {
114173
});
115174

116175
app.on("window-all-closed", function () {
117-
if (process.platform !== "darwin") app.quit();
176+
app.quit();
118177
});
119178

120179

0 commit comments

Comments
 (0)