Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
Initial support for mimetypes, i.e. hyperlink "qz:launch"
Browse files Browse the repository at this point in the history
Support is currently Windows only
Partial support for #94
  • Loading branch information
tresf committed Nov 5, 2015
1 parent 93838ed commit 66185b2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion ant/windows/windows-packager.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ Section
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${socket.name}" \
"EstimatedSize" "${build.socket.size}"

; Mimetype support, e.g. ${vendor.name}:launch
WriteRegStr HKCR "${vendor.name}" "" "URL:${socket.name} Protocol"
WriteRegStr HKCR "${vendor.name}" "URL Protocol" ""
WriteRegStr HKCR "${vendor.name}\DefaultIcon" "" "$\"$INSTDIR\${windows.icon}$\",1"
WriteRegStr HKCR "${vendor.name}\shell\open\command" "" "$\"$INSTDIR\${build.socket.name}.exe$\" $\"%1$\""

WriteUninstaller "$INSTDIR\uninstall.exe"

; Prevent launching exe from SysWOW64
Expand Down Expand Up @@ -111,7 +117,7 @@ Section
${EndIf}
${EndIf}

CreateShortCut "$SMPROGRAMS\${socket.name}.lnk" "$INSTDIR\${build.socket.name}.jar" "" "$INSTDIR\${windows.icon}" 0
CreateShortCut "$SMPROGRAMS\${socket.name}.lnk" "$INSTDIR\${build.socket.name}.exe" "" "$INSTDIR\${windows.icon}" 0

; Delete matching firewall rules
DetailPrint "Removing ${socket.name} firewall rules..."
Expand Down
2 changes: 2 additions & 0 deletions ant/windows/windows.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ windows.keygen.tool=certutil.exe
windows.nsis.addons=${basedir}/ant/windows/nsis
windows.packager.in=${basedir}/ant/windows/windows-packager.nsi.in
windows.packager.out=${build.dir}/windows-packager.nsi
windows.launcher.in=${basedir}/ant/windows/windows-launcher.nsi.in
windows.launcher.out=${dist.socket.dir}/windows-launcher.nsi

# jscript/nsis shared error codes
windows.err.java=2
Expand Down
12 changes: 10 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,23 @@
<property file="ant/windows/windows.properties"/>
<copy file="${branding.dir}/${windows.icon}" tofile="${dist.socket.dir}/${windows.icon}" />

<delete file="${windows.packager.out}"/>
<copy file="${windows.packager.in}" tofile="${windows.packager.out}" >
<copy file="${windows.packager.in}" tofile="${windows.packager.out}" overwrite="true">
<filterchain><expandproperties/></filterchain>
</copy>

<copy file="${windows.launcher.in}" tofile="${windows.launcher.out}" overwrite="true">
<filterchain><expandproperties/></filterchain>
</copy>

<copy file="${windows.keygen.in}" tofile="${windows.keygen.out}" >
<filterchain><expandproperties/></filterchain>
</copy>

<exec executable="${nsisbin}" failonerror="true" >
<arg value="${windows.launcher.out}"/>
</exec>
<delete file="${windows.launcher.out}"/>

<exec executable="${nsisbin}" failonerror="true" >
<arg value="${windows.packager.out}"/>
</exec>
Expand Down

0 comments on commit 66185b2

Please sign in to comment.