Debian Codegraph @

Source/manifest.h

raw
1 /*
2 * manifest.h
3 *
4 * This file is a part of NSIS.
5 *
6 * Copyright (C) 1999-2026 Nullsoft and Contributors
7 *
8 * Licensed under the zlib/libpng license (the "License");
9 * you may not use this file except in compliance with the License.
10 *
11 * Licence details can be found in the file COPYING.
12 *
13 * This software is provided 'as-is', without any express or implied
14 * warranty.
15 *
16 * Reviewed for Unicode support by Jim Park -- 08/22/2007
17 */
18
19 #ifndef ___MANIFEST_H___
20 #define ___MANIFEST_H___
21
22 #include "tstring.h"
23 #include "strlist.h"
24
25 namespace manifest
26 {
27 enum flags
28 {
29 disablewindowfiltering = 0x01, // Win8+ (Allow EnumWindows() to return Windows 8 immersive apps)
30 gdiscaling = 0x02, // Win10FU1703+ blogs.windows.com/windowsdeveloper/2017/05/19/improving-high-dpi-experience-gdi-based-desktop-apps/
31 flags_default = 0
32 };
33
34 enum comctl // WinXP+
35 {
36 comctl_old,
37 comctl_xp
38 };
39
40 enum exec_level // WinVista+
41 {
42 exec_level_none,
43 exec_level_user,
44 exec_level_highest,
45 exec_level_admin
46 };
47
48 enum dpiaware // WinVista+
49 {
50 dpiaware_notset,
51 dpiaware_false,
52 dpiaware_true, // System DPI on Vista+
53 dpiaware_permonitor, // System DPI on Vista/7/8, PerMonitor on 8.1+ (Undocumented because we don't handle WM_DPICHANGED)
54 dpiaware_explorer // Win8.1+? Undocumented?
55 };
56
57 enum longpathaware
58 {
59 lpaware_notset,
60 lpaware_false,
61 lpaware_true // Win10.0.14352+
62 };
63
64 class SupportedOSList // Win7+
65 {
66 StringList m_list;
67 bool m_isdefaultlist;
68 public:
69 SupportedOSList() : m_isdefaultlist(false) {}
70
71 bool append(const TCHAR* osid);
72 int getcount() const { return m_list.getnum(); }
73 bool isdefaultlist() const { return m_isdefaultlist; }
74 const TCHAR* get(int idx)
75 {
76 int pos = m_list.idx2pos(idx);
77 if (-1 == pos) return 0;
78 return m_list.get() + pos;
79 }
80 bool addall();
81 void deleteall()
82 {
83 m_list.deleteall();
84 m_isdefaultlist = false;
85 }
86 void setdefault()
87 {
88 m_list.deleteall();
89 append(_T("Win7"));
90 append(_T("Win8"));
91 append(_T("Win8.1")); // In the default list because GetVersion[Ex] lies if this is not set in the manifest
92 append(_T("Win10"));
93 m_isdefaultlist = true;
94 }
95 };
96
97 typedef struct {
98 flags Flags;
99 dpiaware DPIA;
100 const TCHAR *DPIA2; // Win10FU1607+
101 longpathaware lpaware;
102 SupportedOSList*pSOSL;
103 const TCHAR *MaxVersionTested; // Win10FU1903+ github.com/microsoft/AppConsult-WinAppsModernizationWorkshop/tree/master/Exercise2
104 } SPECIFICATION;
105
106 std::string generate(comctl, exec_level, const SPECIFICATION&);
107 bool addappendstring(const TCHAR*path, const TCHAR*data);
108
109 };
110
111 #endif//!___MANIFEST_H___