// DT Util Nullsoft Installer System Plugin // // Douglas Thrift // // $Id$ #ifdef _DEBUG #pragma warning(disable:4786) #endif #include #include #include using namespace std; #include #include "D:\NSIS\Contrib\ExDll\exdll.h" extern "C" void __declspec(dllexport) CheckNT(HWND hwndParent, int string_size, char* variables, stack_t** stacktop) { EXDLL_INIT(); { OSVERSIONINFO os; os.dwOSVersionInfoSize = sizeof(os); GetVersionEx(&os); if (os.dwPlatformId == VER_PLATFORM_WIN32_NT) { pushstring("true"); } else { pushstring("false"); } } } extern "C" void __declspec(dllexport) GetArgs(HWND hwndParent, int string_size, char* variables, stack_t** stacktop) { EXDLL_INIT(); { istringstream line(getuservariable(INST_CMDLINE)); vector args; do { string arg; if (line.peek() == '\"') { line.ignore(); getline(line, arg, '\"'); } else { line >> arg; line.ignore(); } if (arg != "") args.push_back(arg); } while (line.good()); for (unsigned index = args.size(); index > 0; index--) { char* arg = new char[args[index - 1].size() + 1]; sprintf(arg, args[index - 1].c_str()); pushstring(arg); delete [] arg; } } } BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { return TRUE; }