tabs to spaces
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4602 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
3bc88ed854
commit
fb6f254183
1 changed files with 73 additions and 73 deletions
|
@ -11,115 +11,115 @@
|
||||||
#define NSISFunction(funcname) extern "C" void __declspec(dllexport) funcname(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
|
#define NSISFunction(funcname) extern "C" void __declspec(dllexport) funcname(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
|
||||||
|
|
||||||
extern "C" BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) {
|
extern "C" BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
||||||
NSISFunction(Register) {
|
NSISFunction(Register) {
|
||||||
|
|
||||||
EXDLL_INIT();
|
|
||||||
|
|
||||||
char filename[1024];
|
EXDLL_INIT();
|
||||||
popstring(filename);
|
|
||||||
|
|
||||||
wchar_t ole_filename[1024];
|
char filename[1024];
|
||||||
MultiByteToWideChar(CP_ACP, 0, filename, 1024, ole_filename, 1024);
|
popstring(filename);
|
||||||
|
|
||||||
ITypeLib* typeLib;
|
wchar_t ole_filename[1024];
|
||||||
HRESULT hr;
|
MultiByteToWideChar(CP_ACP, 0, filename, 1024, ole_filename, 1024);
|
||||||
|
|
||||||
hr = LoadTypeLib(ole_filename, &typeLib);
|
ITypeLib* typeLib;
|
||||||
|
HRESULT hr;
|
||||||
if (SUCCEEDED(hr)) {
|
|
||||||
|
|
||||||
RegisterTypeLib(typeLib, ole_filename, NULL);
|
hr = LoadTypeLib(ole_filename, &typeLib);
|
||||||
|
|
||||||
hr = typeLib->Release();
|
if (SUCCEEDED(hr)) {
|
||||||
|
|
||||||
|
RegisterTypeLib(typeLib, ole_filename, NULL);
|
||||||
|
|
||||||
|
hr = typeLib->Release();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSISFunction(UnRegister) {
|
NSISFunction(UnRegister) {
|
||||||
|
|
||||||
EXDLL_INIT();
|
EXDLL_INIT();
|
||||||
|
|
||||||
char filename[1024];
|
char filename[1024];
|
||||||
popstring(filename);
|
popstring(filename);
|
||||||
|
|
||||||
wchar_t ole_filename[1024];
|
wchar_t ole_filename[1024];
|
||||||
MultiByteToWideChar(CP_ACP, 0, filename, 1024, ole_filename, 1024);
|
MultiByteToWideChar(CP_ACP, 0, filename, 1024, ole_filename, 1024);
|
||||||
|
|
||||||
ITypeLib* typeLib;
|
ITypeLib* typeLib;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = LoadTypeLibEx(ole_filename, REGKIND_NONE, &typeLib);
|
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
hr = LoadTypeLibEx(ole_filename, REGKIND_NONE, &typeLib);
|
||||||
{
|
|
||||||
|
|
||||||
TLIBATTR* typelibAttr;
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
hr = typeLib->GetLibAttr(&typelibAttr);
|
|
||||||
|
TLIBATTR* typelibAttr;
|
||||||
if(SUCCEEDED(hr))
|
|
||||||
{
|
hr = typeLib->GetLibAttr(&typelibAttr);
|
||||||
|
|
||||||
UnRegisterTypeLib(typelibAttr->guid,
|
if(SUCCEEDED(hr))
|
||||||
typelibAttr->wMajorVerNum,
|
{
|
||||||
typelibAttr->wMinorVerNum,
|
|
||||||
typelibAttr->lcid,
|
UnRegisterTypeLib(typelibAttr->guid,
|
||||||
typelibAttr->syskind);
|
typelibAttr->wMajorVerNum,
|
||||||
|
typelibAttr->wMinorVerNum,
|
||||||
|
typelibAttr->lcid,
|
||||||
|
typelibAttr->syskind);
|
||||||
|
|
||||||
|
typeLib->ReleaseTLibAttr(typelibAttr);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
typeLib->Release();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
typeLib->ReleaseTLibAttr(typelibAttr);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
typeLib->Release();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSISFunction(GetLibVersion) {
|
NSISFunction(GetLibVersion) {
|
||||||
|
|
||||||
EXDLL_INIT();
|
EXDLL_INIT();
|
||||||
|
|
||||||
char filename[1024];
|
char filename[1024];
|
||||||
popstring(filename);
|
popstring(filename);
|
||||||
|
|
||||||
wchar_t ole_filename[1024];
|
wchar_t ole_filename[1024];
|
||||||
MultiByteToWideChar(CP_ACP, 0, filename, 1024, ole_filename, 1024);
|
MultiByteToWideChar(CP_ACP, 0, filename, 1024, ole_filename, 1024);
|
||||||
|
|
||||||
ITypeLib* typeLib;
|
ITypeLib* typeLib;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = LoadTypeLib(ole_filename, &typeLib);
|
hr = LoadTypeLib(ole_filename, &typeLib);
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
{
|
|
||||||
|
|
||||||
TLIBATTR* typelibAttr;
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
hr = typeLib->GetLibAttr(&typelibAttr);
|
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
TLIBATTR* typelibAttr;
|
||||||
{
|
|
||||||
|
|
||||||
char buf[33];
|
|
||||||
|
|
||||||
wsprintf(buf, "%d", typelibAttr->wMajorVerNum);
|
hr = typeLib->GetLibAttr(&typelibAttr);
|
||||||
pushstring(buf);
|
|
||||||
wsprintf(buf, "%d", typelibAttr->wMinorVerNum);
|
if (SUCCEEDED(hr))
|
||||||
pushstring(buf);
|
{
|
||||||
|
|
||||||
|
char buf[33];
|
||||||
|
|
||||||
|
wsprintf(buf, "%d", typelibAttr->wMajorVerNum);
|
||||||
|
pushstring(buf);
|
||||||
|
wsprintf(buf, "%d", typelibAttr->wMinorVerNum);
|
||||||
|
pushstring(buf);
|
||||||
|
|
||||||
typeLib->ReleaseTLibAttr(typelibAttr);
|
typeLib->ReleaseTLibAttr(typelibAttr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typeLib->Release();
|
typeLib->Release();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue