Skip to content

Commit de46896

Browse files
committed
Add scheme to package config
1 parent 2822d7f commit de46896

6 files changed

Lines changed: 46 additions & 58 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mix.lock
12
/tmp
23
*.log
34
tmp.pem

lib/package.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ defmodule Desktop.Deployment.Package do
2323
# defined during the process
2424
app_name: nil,
2525
release: nil,
26-
priv: %{}
26+
priv: %{},
27+
schemes: []
2728

2829
def copy_extra_files(%Package{release: %Mix.Release{path: rel_path, version: vsn} = rel} = pkg) do
2930
vm_args = toolpath("rel/vm.args.eex")

mix.lock

Lines changed: 0 additions & 17 deletions
This file was deleted.

rel/linux/install.eex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ GenericName[en]=<%= @package.description %>
2828
Comment[en]=<%= @package.description_long %>
2929
Icon=%ROOTDIR%/lib/<%= @package.app_name %>-<%= @release.version %>/<%= @package.icon %>
3030
Categories=<%= @package.category_gnome %>
31+
<%= for scheme in @package.schemes do %>
32+
MimeType=x-scheme-handler/<%= scheme %>;
33+
<% end %>
3134
EOF
3235

3336
chmod +x $INSTALL_DIR/$APP_NAME.desktop $INSTALL_DIR/$APP_NAME

rel/macosx/Info.plist.eex

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,53 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>CFBundleName</key>
6-
<string><%= @package.name %></string>
75
<key>CFBundleDisplayName</key>
86
<string><%= @package.name %></string>
9-
<key>CFBundleDevelopmentRegion</key>
10-
<string>en</string>
7+
<key>CFBundleName</key>
8+
<string><%= @package.name %></string>
9+
<key>CFBundleIdentifier</key>
10+
<string><%= @package.identifier %></string>
1111
<key>CFBundleExecutable</key>
1212
<string>run</string>
1313
<key>CFBundleIconFile</key>
1414
<string>icons.icns</string>
15-
<key>CFBundleIdentifier</key>
16-
<string><%= @package.identifier %></string>
17-
<key>CFBundleInfoDictionaryVersion</key>
18-
<string>6.0</string>
1915
<key>CFBundlePackageType</key>
2016
<string>APPL</string>
2117
<key>CFBundleShortVersionString</key>
2218
<string><%= @release.version %></string>
23-
<key>CFBundleSignature</key>
24-
<string>????</string>
2519
<key>CFBundleVersion</key>
2620
<string><%= @release.version %></string>
21+
<key>CFBundleInfoDictionaryVersion</key>
22+
<string>6.0</string>
2723
<key>LSMinimumSystemVersion</key>
28-
<string>10.12.0</string>
29-
<key>LSApplicationCategoryType</key>
30-
<string><%= @package.category_macos %></string>
31-
<key>LSUIElement</key>
32-
<true/>
33-
<key>LSMultipleInstancesProhibited</key>
34-
<true/>
35-
<key>NSPrincipalClass</key>
36-
<string>NSApplication</string>
37-
<key>LSArchitecturePriority</key>
38-
<array>
39-
<string>x86_64</string>
40-
</array>
41-
<key>CFBundleDocumentTypes</key>
24+
<string>10.13</string>
25+
<key>NSUserNotificationAlertStyle</key>
26+
<string>alert</string>
27+
<key>CFBundleURLTypes</key>
4228
<array>
4329
<dict>
44-
<key>CFBundleTypeName</key>
45-
<string>All Files</string>
46-
<key>LSHandlerRank</key>
47-
<string>Alternate</string>
48-
<key>LSItemContentTypes</key>
30+
<key>CFBundleURLName</key>
31+
<string><%= @package.name %> Protocol</string>
32+
<key>CFBundleURLSchemes</key>
4933
<array>
50-
<string>public.data</string>
51-
<string>public.content</string>
34+
<%= for scheme in @package.schemes do %>
35+
<string><%= scheme %></string>
36+
<% end %>
5237
</array>
5338
</dict>
5439
</array>
40+
<key>NSAppTransportSecurity</key>
41+
<dict>
42+
<key>NSExceptionDomains</key>
43+
<dict>
44+
<key>localhost</key>
45+
<dict>
46+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
47+
<true/>
48+
<key>NSIncludesSubdomains</key>
49+
<true/>
50+
</dict>
51+
</dict>
52+
</dict>
5553
</dict>
5654
</plist>

rel/win32/app.nsi.eex

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ WriteRegStr HKCU "${MY_STARTMENUPAGE_REGISTRY_KEY}" "" $INSTDIR
8888
;WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "<%= @package.name %>" "${TARGET}"
8989

9090
; Register for mimetype
91-
;WriteRegStr HKCR \
92-
; "app" \
93-
; "" "URL:app Protocol"
94-
;WriteRegStr HKCR \
95-
; "app" \
96-
; "URL Protocol" ""
97-
;WriteRegStr HKCR \
98-
; "app\shell\open\command" \
99-
; "" '"$WINDIR\system32\wscript.exe" "${TARGET}" "%1"'
91+
<%= for scheme in @package.schemes do %>
92+
WriteRegStr HKCR \
93+
"<%= scheme %>" \
94+
"" "URL:<%= scheme %> Protocol"
95+
WriteRegStr HKCR \
96+
"<%= scheme %>" \
97+
"URL Protocol" ""
98+
WriteRegStr HKCR \
99+
"<%= scheme %>\shell\open\command" \
100+
"" '"$WINDIR\system32\wscript.exe" "${TARGET}" "%1"'
101+
<% end %>
100102

101103
; Create uninstaller before shortcuts
102104
WriteUninstaller "$INSTDIR\Uninstall.exe"

0 commit comments

Comments
 (0)