Add support for Appvayor Windows ci.
[quassel.git] / scripts / build / SnoreNotify.nsh
diff --git a/scripts/build/SnoreNotify.nsh b/scripts/build/SnoreNotify.nsh
new file mode 100644 (file)
index 0000000..a83aecd
--- /dev/null
@@ -0,0 +1,22 @@
+!include LogicLib.nsh
+!include WordFunc.nsh
+
+Function SnoreWinVer
+    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+    ${VersionCompare} "6.2" $R0 $R0
+    ${If} $R0 == 1
+        Push "NotWin8"
+    ${Else}
+        Push "AtLeastWin8"
+    ${EndIf}
+FunctionEnd
+
+!macro SnoreShortcut path exe appID
+    Call SnoreWinVer
+    Pop $0
+    ${If} $0 == "AtLeastWin8"
+        nsExec::ExecToLog '"${SnoreToastExe}" -install "${path}" "${exe}" "${appID}"'
+    ${Else}
+        CreateShortCut "${path}" "${exe}"
+    ${EndIf}
+!macroend