From: <che...@us...> - 2008-11-12 15:35:55
|
Revision: 2331 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2331&view=rev Author: chef_koch Date: 2008-11-12 15:35:43 +0000 (Wed, 12 Nov 2008) Log Message: ----------- - added common mp nsis stuff - only formatting style changes in addremovepage Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/GetVersion.dll trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Plugin/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Plugin/xml.dll trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Readme.html trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Build.cmd trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Install.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Install.dsp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Install.dsw trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/Install.ico trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/Install.rc trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/Resource.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/StackFunc.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/action_store.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/action_store.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/build.cmd trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/byte_stream.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/lex_token.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/lex_util.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/lex_util.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/node_set.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/node_set.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinystr.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinystr.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxml.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxml.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxmlerror.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxmlparser.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxpath_conf.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tokenlist.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tokenlist.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml.dsp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml.dsw trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml_util.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml_util.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_expression.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_expression.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_processor.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_processor.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stack.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stack.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_static.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_static.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stream.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stream.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_syntax.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_syntax.h trunk/plugins/IR Server Suite/setup/CommonNSIS/include-DotNetFramework.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-WinVerEx.nsh Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,740 @@ +#include <windows.h> +#include "..\ExDll\exdll.h" +#include "shlwapi.h" +#include <stdio.h> + +/** + GetVersion.cpp - Windows version info plugin for NSIS by Afrow UK + Based on example script by Microsoft at: + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp +*/ + +#define ERROR_STRING TEXT("GetVersion error") +#define SM_SERVERR2 89 +typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); +typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD); + +HINSTANCE g_hInstance; + +#ifndef VER_PLATFORM_WIN32_CE +#define VER_PLATFORM_WIN32_CE 3 +#endif + +#ifndef VER_SUITE_STORAGE_SERVER +#define VER_SUITE_STORAGE_SERVER 0x00002000 +#endif +#ifndef VER_SUITE_COMPUTE_SERVER +#define VER_SUITE_COMPUTE_SERVER 0x00004000 +#endif + +#define PRODUCT_UNDEFINED 0x00000000 + +#define PRODUCT_ULTIMATE 0x00000001 +#define PRODUCT_HOME_BASIC 0x00000002 +#define PRODUCT_HOME_PREMIUM 0x00000003 +#define PRODUCT_ENTERPRISE 0x00000004 +#define PRODUCT_HOME_BASIC_N 0x00000005 +#define PRODUCT_BUSINESS 0x00000006 +#define PRODUCT_STANDARD_SERVER 0x00000007 +#define PRODUCT_DATACENTER_SERVER 0x00000008 +#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009 +#define PRODUCT_ENTERPRISE_SERVER 0x0000000A +#define PRODUCT_STARTER 0x0000000B +#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C +#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D +#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E +#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F +#define PRODUCT_BUSINESS_N 0x00000010 +#define PRODUCT_WEB_SERVER 0x00000011 +#define PRODUCT_CLUSTER_SERVER 0x00000012 +#define PRODUCT_HOME_SERVER 0x00000013 +#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 +#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 +#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 +#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 +#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 +#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 + +#define PRODUCT_UNLICENSED 0xABCDABCD + +BOOL callGetVersion(LPOSVERSIONINFOEXA posvi, BOOL *pbOsVersionInfoEx) +{ + // Try calling GetVersionEx using the OSVERSIONINFOEX structure. + // If that fails, try using the OSVERSIONINFO structure. + + posvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + + if (!(*pbOsVersionInfoEx = GetVersionEx((LPOSVERSIONINFOA)posvi))) + { + posvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if (!GetVersionEx((LPOSVERSIONINFOA)posvi)) + { + pushstring(ERROR_STRING); + return FALSE; + } + } + return TRUE; +} + +extern "C" +void __declspec(dllexport) WindowsName(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsName = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Test for the specific product. + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + szOsName = "Vista"; + else szOsName = "Server Longhorn"; + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) + { + + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + + if (NULL != pGNSI) + pGNSI(&si); + + if (GetSystemMetrics(SM_SERVERR2)) + szOsName = "Server 2003 R2"; + else if (osvi.wProductType == VER_NT_WORKSTATION && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + szOsName = "XP x64"; + else szOsName = "Server 2003"; + + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + szOsName = "XP"; + + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + szOsName = "2000"; + + else if (osvi.dwMajorVersion <= 4) + szOsName = "NT"; + + break; + + // Test for Windows CE. + case VER_PLATFORM_WIN32_CE: + szOsName = "CE"; + break; + + // Test for the Windows Me/98/95. + case VER_PLATFORM_WIN32_WINDOWS: + + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) + { + szOsName = "95"; + if (osvi.szCSDVersion[1]=='C' || osvi.szCSDVersion[1]=='B') + lstrcat(szOsName, " OSR2"); + } + + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) + { + szOsName = "98"; + if (osvi.szCSDVersion[1] == 'A') + lstrcat(szOsName, " SE"); + } + + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) + { + szOsName = "ME"; + } + break; + + case VER_PLATFORM_WIN32s: + + szOsName = "Win32s"; + break; + } + pushstring(szOsName); + } +} + +extern "C" +void __declspec(dllexport) WindowsType(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsType = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + PGPI pGPI; + DWORD dwType; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + //ZeroMemory(&si, sizeof(SYSTEM_INFO)); + + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); + if (pGNSI) + pGNSI(&si); + else GetSystemInfo(&si); + + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) + { + pGPI = (PGPI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo"); + pGPI(6, 0, 0, 0, &dwType); + + switch(dwType) + { + case PRODUCT_ULTIMATE: + szOsType = "Ultimate Edition"; + break; + case PRODUCT_HOME_PREMIUM: + szOsType = "Home Premium Edition"; + break; + case PRODUCT_HOME_BASIC: + szOsType = "Home Basic Edition"; + break; + case PRODUCT_ENTERPRISE: + szOsType = "Enterprise Edition"; + break; + case PRODUCT_BUSINESS: + szOsType = "Business Edition"; + break; + case PRODUCT_STARTER: + szOsType = "Starter Edition"; + break; + } + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + { + HKEY hKeyMCE, hKeyTPCE; + DWORD dwBufLen; + LONG lRetMCE, lRetTPCE; + DWORD dwInstMCE = 0, dwInstTPCE = 0; + + lRetMCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\MediaCenter", 0, KEY_QUERY_VALUE, &hKeyMCE); + lRetTPCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\TabletPC" , 0, KEY_QUERY_VALUE, &hKeyTPCE); + + if (lRetMCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetMCE = RegQueryValueEx(hKeyMCE, "Installed", NULL, NULL, (LPBYTE)dwInstMCE, &dwBufLen); + } + if (lRetTPCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetTPCE = RegQueryValueEx(hKeyTPCE, "Installed", NULL, NULL, (LPBYTE)dwInstTPCE, &dwBufLen); + } + + if (lRetMCE == ERROR_SUCCESS) + RegCloseKey(hKeyMCE); + if (lRetTPCE == ERROR_SUCCESS) + RegCloseKey(hKeyTPCE); + + if (dwInstMCE == 0 && dwInstTPCE == 0) + { + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + szOsType = "Home Edition"; + else if (osvi.wSuiteMask & VER_SUITE_EMBEDDEDNT) + szOsType = "Embedded"; + else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + szOsType = "Professional x64 Edition"; + else + szOsType = "Professional"; + } + else if (dwInstMCE == 1) + szOsType = "Media Center Edition"; + else if (dwInstTPCE == 1) + szOsType = "Tablet PC Edition"; + else + szOsType = ""; + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + szOsType = "Professional"; + else if (osvi.dwMajorVersion == 4) + szOsType = "Workstation 4.0"; + } + +/* switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + + if (NULL != pGNSI) + pGNSI(&si); + + if (osvi.wProductType == VER_NT_WORKSTATION) + { + if (osvi.dwMajorVersion == 4) + szOsType = "Workstation 4.0"; + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + { + HKEY hKeyMCE, hKeyTPCE; + DWORD dwBufLen; + LONG lRetMCE, lRetTPCE; + DWORD dwInstMCE = 0, dwInstTPCE = 0; + + lRetMCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\MediaCenter", 0, KEY_QUERY_VALUE, &hKeyMCE); + lRetTPCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\TabletPC" , 0, KEY_QUERY_VALUE, &hKeyTPCE); + + if (lRetMCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetMCE = RegQueryValueEx(hKeyMCE, "Installed", NULL, NULL, (LPBYTE)dwInstMCE, &dwBufLen); + } + if (lRetTPCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetTPCE = RegQueryValueEx(hKeyTPCE, "Installed", NULL, NULL, (LPBYTE)dwInstTPCE, &dwBufLen); + } + + if (lRetMCE == ERROR_SUCCESS) + RegCloseKey(hKeyMCE); + if (lRetTPCE == ERROR_SUCCESS) + RegCloseKey(hKeyTPCE); + + if (dwInstMCE == 0 && dwInstTPCE == 0) + { + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + szOsType = "Home Edition"; + else if (osvi.wSuiteMask & VER_SUITE_EMBEDDEDNT) + szOsType = "Embedded"; + else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + szOsType = "Professional x64 Edition"; + else + szOsType = "Professional"; + } + else if (dwInstMCE == 1) + szOsType = "Media Center Edition"; + else if (dwInstTPCE == 1) + szOsType = "Tablet PC Edition"; + else + szOsType = ""; + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + szOsType = "Professional"; + else if (osvi.dwMajorVersion == 6) + { + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + szOsType = "Home Premium/Basic"; + } + else szOsType = ""; + } + else szOsType = ""; + + break; + }*/ + pushstring(szOsType); + + } +} + +extern "C" +void __declspec(dllexport) WindowsVersion(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char szOsVer[16]; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + wsprintf(szOsVer, "%i.%i", osvi.dwMajorVersion, osvi.dwMinorVersion); + pushstring(szOsVer); + } +} + +extern "C" +void __declspec(dllexport) WindowsPlatformId(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char szOsPId[16]; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + wsprintf(szOsPId, "%i", osvi.dwPlatformId); + pushstring(szOsPId); + } +} + +extern "C" +void __declspec(dllexport) WindowsPlatformArchitecture(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsPlatArch = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + + if (NULL != pGNSI) + { + pGNSI(&si); + + if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) + szOsPlatArch = "64"; + else + szOsPlatArch = "32"; + } + else + szOsPlatArch = "32"; + + pushstring(szOsPlatArch); + } + } +} + +extern "C" +void __declspec(dllexport) WindowsServerName(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsServName = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + PGPI pGPI; + DWORD dwType; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Test for specific product on Windows NT 4.0 SP6 and later. + if (bOsVersionInfoEx) + { + // Test for the workstation type. + if (osvi.wProductType == VER_NT_WORKSTATION) + { + // Test for the server type. + if (osvi.wProductType == VER_NT_SERVER || + osvi.wProductType == VER_NT_DOMAIN_CONTROLLER) + { + if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==2) + { + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + if (pGNSI) + pGNSI(&si); + + if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64) + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter Edition for Itanium-based Systems"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Enterprise Edition for Itanium-based Systems"; + } + + else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter x64 Edition"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Enterprise x64 Edition"; + else szOsServName = "Standard x64 Edition"; + } + + else + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter Edition"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Enterprise Edition"; + else if (osvi.wSuiteMask == VER_SUITE_BLADE) + szOsServName = "Enterprise Edition"; + else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER) + szOsServName = "Storage Server 2003"; + else if (osvi.wSuiteMask == VER_SUITE_COMPUTE_SERVER) + szOsServName = "Server 2003"; + else if (osvi.wSuiteMask == VER_SUITE_SMALLBUSINESS) + szOsServName = "Small Business Server"; + else szOsServName = "Standard Edition"; + } + } + else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0) + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter Server"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Advanced Server"; + else szOsServName = "Server"; + } + else if (osvi.dwMajorVersion==6 && osvi.dwMinorVersion==0) + { + if (!osvi.wSuiteMask & VER_NT_WORKSTATION) + szOsServName = "Server 2008"; + else + { + pGPI = (PGPI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo"); + pGPI(6, 0, 0, 0, &dwType); + + switch(dwType) + { + case PRODUCT_DATACENTER_SERVER: + case PRODUCT_DATACENTER_SERVER_CORE: + szOsServName = "Datacenter Edition"; + break; + case PRODUCT_ENTERPRISE_SERVER: + case PRODUCT_ENTERPRISE_SERVER_CORE: + szOsServName = "Enterprise Edition"; + break; + case PRODUCT_STANDARD_SERVER: + case PRODUCT_STANDARD_SERVER_CORE: + szOsServName = "Standard Edition"; + break; + case PRODUCT_ENTERPRISE_SERVER_IA64: + szOsServName = "Enterprise Edition for Itanium-based Systems"; + break; + case PRODUCT_SMALLBUSINESS_SERVER: + szOsServName = "Small Business Server"; + break; + case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: + szOsServName = "Small Business Server Premium Edition"; + break; + case PRODUCT_CLUSTER_SERVER: + szOsServName = "Cluster Server Edition"; + break; + case PRODUCT_WEB_SERVER: + szOsServName = "Web Server Edition"; + break; + } + } + } + else // Windows NT 4.0 + { + if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Server 4.0 Enterprise Edition"; + else szOsServName = "Server 4.0"; + } + } + } + + // Test for specific product on Windows NT 4.0 SP5 and earlier + } + else + { + HKEY hKey; + char szProductType[128]; + DWORD dwBufLen; + LONG lRet; + + lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\ProductOptions", 0, KEY_QUERY_VALUE, &hKey); + if (lRet != ERROR_SUCCESS) + szOsServName = ERROR_STRING; + else + { + dwBufLen = sizeof(szProductType); + lRet = RegQueryValueEx(hKey, "ProductType", NULL, NULL, (LPBYTE)szProductType, &dwBufLen); + if (lRet != ERROR_SUCCESS) + szOsServName = ERROR_STRING; + else + { + RegCloseKey(hKey); + + if (lstrcmpi("WINNT", szProductType) == 0) + szOsServName = "Workstation"; + else if (lstrcmpi("LANMANNT", szProductType) == 0) + szOsServName = "Server"; + else if (lstrcmpi("SERVERNT", szProductType) == 0) + szOsServName = "Advanced Server"; + } + } + } + } + pushstring(szOsServName); + } +} + +extern "C" +void __declspec(dllexport) WindowsServicePack(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsServPack = NULL; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Display service pack (if any) and build number. + if (osvi.dwMajorVersion == 4 && + lstrcmpi(osvi.szCSDVersion, "Service Pack 6") == 0) + { + HKEY hKey; + LONG lRet; + + // Test for SP6 versus SP6a. + lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009", 0, KEY_QUERY_VALUE, &hKey); + if (lRet == ERROR_SUCCESS) + szOsServPack = "Service Pack 6a"; + else // Windows NT 4.0 prior to SP6a + szOsServPack = osvi.szCSDVersion; + + RegCloseKey(hKey); + } + else // not Windows NT 4.0 + { + szOsServPack = osvi.szCSDVersion; + } + break; + } + pushstring(szOsServPack); + } +} + +extern "C" +void __declspec(dllexport) WindowsServicePackBuild(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + char szServPackBuild[16]; + wsprintf(szServPackBuild, "%i", osvi.dwBuildNumber & 0xFFFF); + pushstring(szServPackBuild); + } +} + +/*extern "C" +void __declspec(dllexport) IEVersion(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + HINSTANCE hBrowser; + + //Load the DLL. + hBrowser = LoadLibrary(TEXT("shdocvw.dll")); + + if (hBrowser) + { + HRESULT hr = S_OK; + DLLGETVERSIONPROC pDllGetVersion; + + pDllGetVersion = + (DLLGETVERSIONPROC)GetProcAddress(hBrowser, + TEXT("DllGetVersion")); + + if (pDllGetVersion) + { + char buf[32]; + + DLLVERSIONINFO dvi; + + dvi.cbSize = sizeof(dvi); + hr = (*pDllGetVersion)(&dvi); + + if (SUCCEEDED(hr)) + { + wsprintf(buf, "%i", dvi.dwBuildNumber); + pushstring(buf); + wsprintf(buf, "%i.%i", dvi.dwMajorVersion, dvi.dwMinorVersion); + pushstring(buf); + } + + } + else + //If GetProcAddress failed, there is a problem + // with the DLL. + hr = E_FAIL; + + FreeLibrary(hBrowser); + } + } +}*/ + +BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +{ + g_hInstance = (HINSTANCE)hInst; + return TRUE; +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="GetVersion" + ProjectGUID="{970880F8-9482-4AF1-995D-5E0E7207B0A5}" + SccProjectName="" + SccLocalPath=""> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="2" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GetVersion_EXPORTS" + StringPooling="TRUE" + RuntimeLibrary="0" + EnableFunctionLevelLinking="TRUE" + UsePrecompiledHeader="2" + PrecompiledHeaderFile=".\Release/GetVersion.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="TRUE"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile="../../Plugins/GetVersion.dll" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + IgnoreAllDefaultLibraries="TRUE" + ProgramDatabaseFile=".\Release/GetVersion.pdb" + OptimizeForWindows98="1" + EntryPointSymbol="DllMain" + ImportLibrary=".\Release/GetVersion.lib" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Release/GetVersion.tlb" + HeaderFileName=""/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="2" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GetVersion_EXPORTS" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="2" + PrecompiledHeaderFile=".\Debug/GetVersion.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile=".\Debug/GetVersion.dll" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile=".\Debug/GetVersion.pdb" + ImportLibrary=".\Debug/GetVersion.lib" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Debug/GetVersion.tlb" + HeaderFileName=""/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + <File + RelativePath="GetVersion.cpp"> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;GetVersion_EXPORTS;$(NoInherit)"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;GetVersion_EXPORTS;$(NoInherit)" + BasicRuntimeChecks="3"/> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl"> + <File + RelativePath="GetVersion.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,164 @@ + ============================================================== + + GetVersion.dll v0.9 (5kB) by Afrow UK + + Last build: 12th October 2007 + + C++ NSIS plugin that gets Windows & IE version information. + + -------------------------------------------------------------- + + Place GetVersion.dll in your NSIS\Plugins folder or + simply extract all files in the Zip to NSIS\ + + See Examples\GetVersion\Example.nsi for examples of use. + + ============================================================== + The Functions: + + GetVersion::WindowsName + Pop $R0 + + Gets name of Windows. This includes: + Vista + Server Longhorn + Server 2003 + Server 2003 R2 + XP + XP x64 + 2000 + CE + NT + ME + 98 + 98 SE + 95 + 95 OSR2 + Win32s + + --------------------------- + + GetVersion::WindowsType + Pop $R0 + + Gets type of Windows OS. + For Windows NT: + Workstation 4.0 + For Windows XP: + Home Edition + Professional + Professional x64 Edition + Media Center Edition + Tablet PC Edition + (or empty string) + For Windows Vista: + Ultimate Edition + Home Premium Edition + Home Basic Edition + Enterprise Edition + Business Edition + Starter Edition + (or empty string) + + --------------------------- + + GetVersion::WindowsVersion + Pop $R0 + + Gets the Windows version x.x (e.g. 5.1). + + --------------------------- + + GetVersion::WindowsServerName + Pop $R0 + + Gets the installed server name. This includes: + Server + Server 4.0 + Server 4.0 Enterprise Edition + Workstation + Storage Server 2003 + Server 2003 + Server 2008 + Cluster Server Edition + Datacenter Edition + Datacenter Edition for Itanium-based Systems + Datacenter x64 Edition + Enterprise Edition + Enterprise Edition for Itanium-based Systems + Enterprise x64 Edition + Advanced Server + Small Business Server + Small Business Server Premium Edition + Standard Edition + Web Server Edition + (or empty string) + + --------------------------- + + GetVersion::WindowsServicePack + Pop $R0 + + Gets the installed service pack name (e.g. Service Pack 2). + + --------------------------- + + GetVersion::WindowsServicePackBuild + Pop $R0 + + Gets the installed service pack build number (e.g. 2600). + + --------------------------- + + GetVersion::WindowsPlatformId + Pop $R0 + + Gets the platform Id of the installed Windows + (e.g. 1, 2, 3). + + --------------------------- + + GetVersion::WindowsPlatformArchitecture + Pop $R0 + + Gets the architecture of the installed Windows + (e.g. 32, 64). + + ============================================================== + Change Log: + + v0.9 + * Major code clean up. + * All functions now return an empty string if GetVersionEx API call fails. + * Added Windows types and server names for Vista. + + v0.8 + * Fixed WindowsType. + * Removed function to get IE version. + + v0.7 + * WindowsName now returns simple names (not Windows #). + + v0.6 + * Added support for Windows CE. + + v0.5 + * Added support for Windows XP Media Center Edition (in + WindowsType). + * Added support for Windows XP Tablet PC Edition (in + WindowsType). + + v0.4 + * Added WindowsPlatformId. + * Added WindowsPlatformArchitecture. + + v0.3 + * Added support for Windows Vista and Longhorn Server. + + v0.2 + * Added support for Windows x64. + * No support added for Windows Vista as yet (waiting for + Microsoft to update their page for it!) + + v0.1 + * First version. \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,49 @@ +Name "GetVersion Example" +OutFile "GetVersion.exe" +ShowInstDetails show + +Page InstFiles + +Section + + GetVersion::WindowsName + Pop $R0 + DetailPrint "WindowsName:" + DetailPrint " $R0" + + GetVersion::WindowsType + Pop $R0 + DetailPrint "WindowsType:" + DetailPrint " $R0" + + GetVersion::WindowsVersion + Pop $R0 + DetailPrint "WindowsVersion:" + DetailPrint " $R0" + + GetVersion::WindowsServerName + Pop $R0 + DetailPrint "WindowsServerName:" + DetailPrint " $R0" + + GetVersion::WindowsPlatformId + Pop $R0 + DetailPrint "WindowsPlatformId:" + DetailPrint " $R0" + + GetVersion::WindowsPlatformArchitecture + Pop $R0 + DetailPrint "WindowsPlatformArchitecture:" + DetailPrint " $R0" + + GetVersion::WindowsServicePack + Pop $R0 + DetailPrint "WindowsServicePack:" + DetailPrint " $R0" + + GetVersion::WindowsServicePackBuild + Pop $R0 + DetailPrint "WindowsServicePackBuild:" + DetailPrint " $R0" + +SectionEnd \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/GetVersion.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/GetVersion.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,288 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + + +# DEFINES +!define svn_ROOT "..\.." +!define svn_MP "${svn_ROOT}\mediaportal" +!define svn_TVServer "${svn_ROOT}\TvEngine3\TVLibrary" +!define svn_DeployTool "${svn_ROOT}\Tools\MediaPortal.DeployTool" +!define svn_InstallScripts "${svn_ROOT}\Tools\InstallationScripts" + + + + +; TEST APP FOR MP STUFF + +; The name of the installer +Name "test-helpmacros" + +; The file to write +OutFile "${__FILE__}.exe" + +; The default installation directory +InstallDir $DESKTOP\Example1 + +; Request application privileges for Windows Vista +RequestExecutionLevel user +ShowInstDetails show + +;-------------------------------- + +Page license +Page instfiles + +;-------------------------------- + +!define INSTALL_LOG_FILE "$DESKTOP\install_$(^Name).log" + +#!include "x64.nsh" +#!include Sections.nsh +#!include LogicLib.nsh +#!include Library.nsh +#!include FileFunc.nsh +#!include Memento.nsh + +!include LogicLib.nsh + +!include include-CommonMPMacros.nsh + +;-------------------------------- + +; The stuff to install +Section "" ;No components page, name is not important + +SectionEnd ; end the section + +;-------------------------------- + +!macro MediaPortalInstallation + DetailPrint "" + DetailPrint "--------------------------------------" + DetailPrint "- MediaPortal Installation" + DetailPrint "--------------------------------------" + + ${If} ${MP023IsInstalled} + !insertmacro MP_GET_INSTALL_DIR $R0 + DetailPrint "X MP 0.2.3.0 InstDir: $R0" + ${Else} + DetailPrint "! MP 0.2.3.0 is not installed" + ${EndIf} + + ${If} ${MPIsInstalled} + !insertmacro MP_GET_INSTALL_DIR $R0 + DetailPrint "X MediaPortal InstDir: $R0" + ${Else} + DetailPrint "! MediaPortal is not installed" + ${EndIf} + + ${If} ${TVServerIsInstalled} + !insertmacro TVSERVER_GET_INSTALL_DIR $R0 + DetailPrint "X TVServer InstDir: $R0" + ${Else} + DetailPrint "! TVServer is not installed" + ${EndIf} + + + ${If} ${MSI_TVServerIsInstalled} + DetailPrint "X old MSI-based TVServer is installed" + ${Else} + DetailPrint "! old MSI-based TVServer is not installed" + ${EndIf} + + ${If} ${MSI_TVClientIsInstalled} + DetailPrint "X old MSI-based TVClient is installed" + ${Else} + DetailPrint "! old MSI-based TVClient is not installed" + ${EndIf} + +!macroend + +!macro OperationSystemInformation + DetailPrint "" + DetailPrint "--------------------------------------" + DetailPrint "- Operation System Information" + DetailPrint "--------------------------------------" + + GetVersion::WindowsName + Pop $R0 + DetailPrint "GetVersion::WindowsName: $R0" + + !insertmacro GetServicePack $R1 $R2 + DetailPrint "GetServicePack major: $R1" + DetailPrint "GetServicePack minor: $R2" + + ${Switch} $R0 + + ${Case} 'Win32s' + ${Case} '95 OSR2' + ${Case} '95' + ${Case} '98 SE' + ${Case} '98' + ${Case} 'ME' + ${Case} 'NT' + ${Case} 'CE' + ${Case} '2000' + ${Case} 'XP x64' + StrCpy $0 "OSabort" + ${Break} + + ${Case} 'Server 2003' + ${Case} 'Server 2003 R2' + ${Case} 'Server Longhorn' ; Server 2008 + StrCpy $0 "OSwarn" + ${Break} + + ${Case} 'XP' + ${If} $R2 > 0 + StrCpy $0 "OSwarnBetaSP" + ${ElseIf} $R1 < 2 + StrCpy $0 "OSabort" + ${Else} + StrCpy $0 "OSok" + ${EndIf} + ${Break} + + ${Case} 'Vista' + ${If} $R2 > 0 + StrCpy $0 "OSwarnBetaSP" + ${ElseIf} $R1 < 1 + StrCpy $0 "OSwarn" + ${Else} + StrCpy $0 "OSok" + ${EndIf} + ${Break} + + ${Default} + DetailPrint "unknown OS" + StrCpy $0 "OSabort" + ${Break} + + ${EndSwitch} + + ; show warnings for some OS + ${If} $0 == "OSabort" + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_WIN)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${ElseIf} $0 == "OSwarn" + ${If} $DeployMode == 0 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + ${EndIf} + ${ElseIf} $0 == "OSwarnBetaSP" + ${If} $DeployMode == 0 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "You are using a beta Service Pack! $(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + ${EndIf} + ${Else} + ; do nothing + ${EndIf} + +!macroend + +!macro AdditionalInformation + DetailPrint "" + DetailPrint "--------------------------------------" + DetailPrint "- Additional Information" + DetailPrint "--------------------------------------" + + ${If} ${VCRedistIsInstalled} + DetailPrint "X Visual C++ Redistributable is installed" + ${Else} + DetailPrint "! Visual C++ Redistributable is not installed" + ${EndIf} +!macroend + +!macro MediaPortalDirs + DetailPrint "" + DetailPrint "--------------------------------------" + DetailPrint "- Read MediaPortal directories" + DetailPrint "--------------------------------------" + + ${IfNot} ${MP023IsInstalled} + ${AndIfNot} ${MPIsInstalled} + DetailPrint "no MPIsInstalled" + ${else} + !insertmacro MP_GET_INSTALL_DIR $MPdir.Base + ${ReadMediaPortalDirs} $MPdir.Base + ${EndIf} + + DetailPrint "Found the following Entries:" + DetailPrint " Base: $MPdir.Base" + DetailPrint " Config: $MPdir.Config" + DetailPrint " Plugins: $MPdir.Plugins" + DetailPrint " Log: $MPdir.Log" + DetailPrint " CustomInputDevice: $MPdir.CustomInputDevice" + DetailPrint " CustomInputDefault: $MPdir.CustomInputDefault" + DetailPrint " Skin: $MPdir.Skin" + DetailPrint " Language: $MPdir.Language" + DetailPrint " Database: $MPdir.Database" + DetailPrint " Thumbs: $MPdir.Thumbs" + DetailPrint " Weather: $MPdir.Weather" + DetailPrint " Cache: $MPdir.Cache" + DetailPrint " BurnerSupport: $MPdir.BurnerSupport" + +!macroend + + + + +Section + ${LOG_OPEN} + + !insertmacro OperationSystemInformation + !insertmacro AdditionalInformation + + !insertmacro MediaPortalInstallation + !insertmacro MediaPortalDirs + + + + + MessageBox MB_ICONINFORMATION|MB_YESNO "Do kill process test?" IDNO noKillProcess + + ${KILLPROCESS} "MPInstaller.exe" + ${KILLPROCESS} "makensisw.exe" + ${KILLPROCESS} "Input Service Configuration.exe" + + DetailPrint "KillProcess FINISHED" + + noKillProcess: + + + + + +SectionEnd + +Function .onInstFailed + ${LOG_CLOSE} +FunctionEnd + +Function .onInstSuccess + ${LOG_CLOSE} +FunctionEnd + Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1 @@ +!define SVN_REVISION "$WCREV$" \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,142 @@ +Name "XMLTest" +OutFile "XMLTest.exe" + +!include "XML.nsh" +!include "Sections.nsh" + +Var RADIOBUTTON + +Page components +Page instfiles + + +Section "Read 'BBB' example 1" Read1 + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::FirstChildElement} "" $0 $1 + MessageBox MB_OK "xml::FirstChildElement$\n$$0=$0$\n$$1=$1" + + ${xml::NextSiblingElement} "b" $0 $1 + MessageBox MB_OK "xml::NextSiblingElement$\n$$0=$0$\n$$1=$1" + + ${xml::FirstChild} "" $0 $1 + MessageBox MB_OK "xml::FirstChild$\n$$0=$0$\n$$1=$1" + + ${xml::Unload} +SectionEnd + + +Section /o "Read 'BBB' example 2" Read2 + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::GotoPath} "/a/b" $0 + MessageBox MB_OK "xml::GotoPath$\n$$0=$0" + + ${xml::GetText} $0 $1 + MessageBox MB_OK "xml::GetText$\n$$0=$0$\n$$1=$1" + + ${xml::Unload} +SectionEnd + + +Section /o "Read attributes example" ReadAttributes + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::GotoPath} "/a[2]/d" $0 + MessageBox MB_OK "xml::GotoPath$\n$$0=$0" + + ${xml::GetAttribute} "attr2" $0 $1 + MessageBox MB_OK "xml::GetAttribute$\n$$0=$0$\n$$1=$1" + + loop: + ${xml::NextAttribute} $0 $1 $2 + MessageBox MB_YESNO "xml::NextAttribute$\n$$0=$0$\n$$1=$1$\n$$2=$2$\n$\nContinue?" IDYES loop + + #Used only for unload plugin + ${xml::NodeHandle} $0 + + ${xml::Unload} +SectionEnd + + +Section /o "Node replace example" NodeReplace + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::NextSiblingElement} "" $0 $1 + MessageBox MB_OK "xml::NextSiblingElement$\n$$0=$0$\n$$1=$1" + + ${xml::NodeHandle} $R0 + MessageBox MB_OK "xml::NodeHandle$\n$$R0=$R0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::FirstChildElement} "" $0 $1 + MessageBox MB_OK "xml::FirstChildElement$\n$$0=$0$\n$$1=$1" + + ${xml::ReplaceNode} "$R0" $0 + MessageBox MB_OK "xml::ReplaceNode$\n$$0=$0" + + ${xml::SaveFile} "test_saved.xml" $0 + MessageBox MB_OK "xml::SaveFile$\n$$0=$0" + + ${xml::Unload} +SectionEnd + + +Section /o "Search element example" SearchElement + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + loop: + ${xml::FindNextElement} "a" $0 $1 + MessageBox MB_OK "xml::FindNextElement$\n$$0=$0$\n$$1=$1" + + ${xml::ElementPath} $0 + MessageBox MB_YESNO "xml::ElementPath$\n$$0=$0$\n$\nContinue?" IDYES loop + + ${xml::FindCloseElement} + MessageBox MB_OK "xml::FindCloseElement" + + ${xml::Unload} +SectionEnd + + +Section /o "XPath example" XPath + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::XPathString} "count(//*/comment())" $0 $1 + MessageBox MB_OK "xml::XPathString$\n$$0=$0$\n$$1=$1" + + ${xml::Unload} +SectionEnd + + +Function .onInit + StrCpy $RADIOBUTTON ${Read1} +FunctionEnd + +Function .onSelChange + !insertmacro StartRadioButtons $RADIOBUTTON + !insertmacro RadioButton ${Read1} + !insertmacro RadioButton ${Read2} + !insertmacro RadioButton ${ReadAttributes} + !insertmacro RadioButton ${NodeReplace} + !insertmacro RadioButton ${SearchElement} + !insertmacro RadioButton ${XPath} + !insertmacro EndRadioButtons +FunctionEnd Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- world --> +<a> + <a>AAA + <a> + <!-- a --> + <bold>GGG</bold> + </a> + </a> + <!-- b --> + <c>CCC + <m>EEE</m> + </c> + <a>FFF</a> + <b>BBB</b> +</a> +<a> + <d attr1="value1" attr2="value2" attr3="value3" attr4="value4">HHH</d> +</a> Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,449 @@ +!define xml::SetCondenseWhiteSpace `!insertmacro xml::SetCondenseWhiteSpace` + +!macro xml::SetCondenseWhiteSpace _BOOL + xml::_SetCondenseWhiteSpace /NOUNLOAD `${_BOOL}` +!macroend + + +!define xml::SetEncoding `!insertmacro xml::SetEncoding` + +!macro xml::SetEncoding _ENCODING + xml::_SetEncoding /NOUNLOAD `${_ENCODING}` +!macroend + + +!define xml::LoadFile `!insertmacro xml::LoadFile` + +!macro xml::LoadFile _FILE _ERR + xml::_LoadFile /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + + +!define xml::SaveFile `!insertmacro xml::SaveFile` + +!macro xml::SaveFile _FILE _ERR + xml::_SaveFile /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + + +!define xml::DeclarationVersion `!insertmacro xml::DeclarationVersion` + +!macro xml::DeclarationVersion _ERR1 _ERR2 + xml::_DeclarationVersion /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::DeclarationEncoding `!insertmacro xml::DeclarationEncoding` + +!macro xml::DeclarationEncoding _ERR1 _ERR2 + xml::_DeclarationEncoding /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::DeclarationStandalone `!insertmacro xml::DeclarationStandalone` + +!macro xml::DeclarationStandalone _ERR1 _ERR2 + xml::_DeclarationStandalone /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::GetText `!insertmacro xml::GetText` + +!macro xml::GetText _ERR1 _ERR2 + xml::_GetText /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::SetText `!insertmacro xml::SetText` + +!macro xml::SetText _VALUE _ERR + xml::_SetText /NOUNLOAD `${_VALUE}` + Pop ${_ERR} +!macroend + + +!define xml::SetCDATA `!insertmacro xml::SetCDATA` + +!macro xml::SetCDATA _BOOL _ERR + xml::_SetCDATA /NOUNLOAD `${_BOOL}` + Pop ${_ERR} +!macroend + + +!define xml::IsCDATA `!insertmacro xml::IsCDATA` + +!macro xml::IsCDATA _ERR + xml::_IsCDATA /NOUNLOAD + Pop ${_ERR} +!macroend + + +!define xml::GetNodeValue `!insertmacro xml::GetNodeValue` + +!macro xml::GetNodeValue _ERR + xml::_GetNodeValue /NOUNLOAD + Pop ${_ERR} +!macroend + + +!define xml::SetNodeValue `!insertmacro xml::SetNodeValue` + +!macro xml::SetNodeValue _VALUE + xml::_SetNodeValue /NOUNLOAD `${_VALUE}` +!macroend + + +!define xml::FindNextElement `!insertmacro xml::FindNextElement` + +!macro xml::FindNextElement _NAME _ERR1 _ERR2 + xml::_FindNextElement /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::FindCloseElement `!insertmacro xml::FindCloseElement` + +!macro xml::FindCloseElement + xml::_FindCloseElement /NOUNLOAD +!macroend + + +!define xml::RootElement `!insertmacro xml::RootElement` + +!macro xml::RootElement _ERR1 _ERR2 + xml::_RootElement /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::FirstChildElement `!insertmacro xml::FirstChildElement` + +!macro xml::FirstChildElement _NAME _ERR1 _ERR2 + xml::_FirstChildElement /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::FirstChild `!insertmacro xml::FirstChild` + +!macro xml::FirstChild _NAME _ERR1 _ERR2 + xml::_FirstChild /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::LastChild `!insertmacro xml::LastChild` + +!macro xml::LastChild _NAME _ERR1 _ERR2 + xml::_LastChild /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::Parent `!insertmacro xml::Parent` + +!macro xml::Parent _ERR1 _ERR2 + xml::_Parent /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::NoChildren `!insertmacro xml::NoChildren` + +!macro xml::NoChildren _ERR + xml::_NoChildren /NOUNLOAD + Pop ${_ERR} +!macroend + + +!define xml::NextSiblingElement `!insertmacro xml::NextSiblingElement` + +!macro xml::NextSiblingElement _NAME _ERR1 _ERR2 + xml::_NextSiblingElement /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::NextSibling `!insertmacro xml::NextSibling` + +!macro xml::NextSibling _NAME _ERR1 _ERR2 + xml::_NextSibling /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::PreviousSibling `!insertmacro xml::PreviousSibling` + +!macro xml::PreviousSibling _NAME _ERR1 _ERR2 + xml::_PreviousSibling /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::InsertAfterNode `!insertmacro xml::InsertAfterNode` + +!macro xml::InsertAfterNode _HANDLE _ERR + xml::_InsertAfterNode /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::InsertBeforeNode `!insertmacro xml::InsertBeforeNode` + +!macro xml::InsertBeforeNode _HANDLE _ERR + xml::_InsertBeforeNode /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::InsertEndChild `!insertmacro xml::InsertEndChild` + +!macro xml::InsertEndChild _HANDLE _ERR + xml::_InsertEndChild /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::ReplaceNode `!insertmacro xml::ReplaceNode` + +!macro xml::ReplaceNode _HANDLE _ERR + xml::_ReplaceNode /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::RemoveNode `!insertmacro xml::RemoveNode` + +!macro xml::RemoveNode _ERR + xml::_RemoveNode /N... [truncated message content] |