Debian Codegraph @

project/bundles/vcpkg/installer/snorenotify.nsh

raw
1 ;; ============================================================
2 ;
3 ; This file is a part of digiKam project
4 ; https://www.digikam.org
5 ;
6 ; Date : 2025-08-30
7 ; Description : Functions to create application shortcute with SnoreToast.exe.
8 ;
9 ; SPDX-FileCopyrightText: 2025 by Maik Qualmann <metzpinguin at gmail dot com>
10 ;
11 ; SPDX-License-Identifier: GPL-2.0-or-later
12 ;
13 ; ============================================================ ;;
14
15 !ifndef SNORE_NOTIFY_INCLUDED
16 !define SNORE_NOTIFY_INCLUDED
17
18 !include "LogicLib.nsh"
19 !include "WordFunc.nsh"
20
21 Function SnoreWinVer
22
23 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
24 ${VersionCompare} "6.2" $R0 $R0
25
26 ${If} $R0 == 1
27
28 Push "NotWin8"
29
30 ${Else}
31
32 Push "AtLeastWin8"
33
34 ${EndIf}
35
36 FunctionEnd
37
38 !macro SnoreShortcut path exe appID
39
40 Call SnoreWinVer
41 Pop $0
42
43 ${If} $0 == "AtLeastWin8"
44
45 nsExec::ExecToLog '"${SnoreToastExe}" -install "${path}" "${exe}" "${appID}"'
46
47 ${Else}
48
49 CreateShortCut "${path}" "${exe}"
50
51 ${EndIf}
52
53 !macroend
54
55 !endif ;SNORE_NOTIFY_INCLUDED