1 |
< |
// Check NT Nullsoft Installer System Plugin |
2 |
< |
// |
3 |
< |
// Douglas Thrift |
4 |
< |
// |
5 |
< |
// $Id$ |
6 |
< |
|
7 |
< |
#include <windows.h> |
8 |
< |
#include "D:\NSIS\Contrib\ExDll\exdll.h" |
9 |
< |
|
10 |
< |
void __declspec(dllexport) CheckNT(HWND hwndParent, int string_size, char |
11 |
< |
*variables, stack_t **stacktop) |
12 |
< |
{ |
13 |
< |
EXDLL_INIT(); |
14 |
< |
|
15 |
< |
{ |
16 |
< |
OSVERSIONINFO os; |
17 |
< |
|
18 |
< |
os.dwOSVersionInfoSize = sizeof(os); |
19 |
< |
|
20 |
< |
GetVersionEx(&os); |
21 |
< |
|
22 |
< |
if (os.dwPlatformId == VER_PLATFORM_WIN32_NT) |
23 |
< |
{ |
24 |
< |
pushstring("true"); |
25 |
< |
} |
26 |
< |
else |
27 |
< |
{ |
28 |
< |
pushstring("false"); |
29 |
< |
} |
30 |
< |
} |
31 |
< |
} |
32 |
< |
|
33 |
< |
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) |
34 |
< |
{ |
35 |
< |
return TRUE; |
36 |
< |
} |
1 |
> |
// DT Util Nullsoft Installer System Plugin |
2 |
> |
// |
3 |
> |
// Douglas Thrift |
4 |
> |
// |
5 |
> |
// $Id$ |
6 |
> |
|
7 |
> |
#ifdef _DEBUG |
8 |
> |
#pragma warning(disable:4786) |
9 |
> |
#endif |
10 |
> |
|
11 |
> |
#include <string> |
12 |
> |
#include <sstream> |
13 |
> |
#include <vector> |
14 |
> |
|
15 |
> |
using namespace std; |
16 |
> |
|
17 |
> |
#include <windows.h> |
18 |
> |
#include "D:\NSIS\Contrib\ExDll\exdll.h" |
19 |
> |
|
20 |
> |
extern "C" void __declspec(dllexport) CheckNT(HWND hwndParent, int string_size, |
21 |
> |
char* variables, stack_t** stacktop) |
22 |
> |
{ |
23 |
> |
EXDLL_INIT(); |
24 |
> |
|
25 |
> |
{ |
26 |
> |
OSVERSIONINFO os; |
27 |
> |
|
28 |
> |
os.dwOSVersionInfoSize = sizeof(os); |
29 |
> |
|
30 |
> |
GetVersionEx(&os); |
31 |
> |
|
32 |
> |
if (os.dwPlatformId == VER_PLATFORM_WIN32_NT) |
33 |
> |
{ |
34 |
> |
pushstring("true"); |
35 |
> |
} |
36 |
> |
else |
37 |
> |
{ |
38 |
> |
pushstring("false"); |
39 |
> |
} |
40 |
> |
} |
41 |
> |
} |
42 |
> |
|
43 |
> |
extern "C" void __declspec(dllexport) GetArgs(HWND hwndParent, int string_size, |
44 |
> |
char* variables, stack_t** stacktop) |
45 |
> |
{ |
46 |
> |
EXDLL_INIT(); |
47 |
> |
|
48 |
> |
{ |
49 |
> |
istringstream line(getuservariable(INST_CMDLINE)); |
50 |
> |
vector<string> args; |
51 |
> |
|
52 |
> |
do |
53 |
> |
{ |
54 |
> |
string arg; |
55 |
> |
|
56 |
> |
if (line.peek() == '\"') |
57 |
> |
{ |
58 |
> |
line.ignore(); |
59 |
> |
getline(line, arg, '\"'); |
60 |
> |
} |
61 |
> |
else |
62 |
> |
{ |
63 |
> |
line >> arg; |
64 |
> |
line.ignore(); |
65 |
> |
} |
66 |
> |
|
67 |
> |
if (arg != "") args.push_back(arg); |
68 |
> |
} |
69 |
> |
while (line.good()); |
70 |
> |
|
71 |
> |
for (unsigned index = args.size(); index > 0; index--) |
72 |
> |
{ |
73 |
> |
char* arg = new char[args[index - 1].size() + 1]; |
74 |
> |
|
75 |
> |
sprintf(arg, args[index - 1].c_str()); |
76 |
> |
pushstring(arg); |
77 |
> |
|
78 |
> |
delete [] arg; |
79 |
> |
} |
80 |
> |
} |
81 |
> |
} |
82 |
> |
|
83 |
> |
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) |
84 |
> |
{ |
85 |
> |
return TRUE; |
86 |
> |
} |