/*
* msiexec.exe implementation
*
- * Copyright 2004 Vincent Béron
+ * Copyright 2004 Vincent Béron
* Copyright 2005 Mike McCormack
*
* This library is free software; you can redistribute it and/or
" msiexec {/h|/?}\n"
"NOTE: Product code on commandline unimplemented as of yet\n"
"\n"
-"Copyright 2004 Vincent Béron\n";
+"Copyright 2004 Vincent Béron\n";
static const WCHAR ActionAdmin[] = {
'A','C','T','I','O','N','=','A','D','M','I','N',0 };
ret += (*str - '0');
str++;
}
- return 0;
+ return ret;
}
static LPWSTR msi_strdup(LPCWSTR str)
CHAR path[MAX_PATH+12];
DWORD ret = 0;
- scm = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CREATE_SERVICE);
+ scm = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASEA, SC_MANAGER_CREATE_SERVICE);
if (!scm)
{
fprintf(stderr, "Failed to open the service control manager.\n");
return 1;
}
- GetSystemDirectory(path, MAX_PATH);
+ GetSystemDirectoryA(path, MAX_PATH);
lstrcatA(path, "\\msiexec.exe /V");
service = CreateServiceA(scm, "MSIServer", "MSIServer", GENERIC_ALL,
static int chomp( WCHAR *str )
{
- enum chomp_state state = cs_whitespace;
+ enum chomp_state state = cs_token;
WCHAR *p, *out;
- int count = 0, ignore;
+ int count = 1, ignore;
for( p = str, out = str; *p; p++ )
{
process_args(buf, pargc, pargv);
ret = TRUE;
}
+ HeapFree(GetProcessHeap(), 0, buf);
}
RegCloseKey(hkeyArgs);
return ret;
}
-int main(int argc, char **argv)
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
int i;
BOOL FunctionInstall = FALSE;
LPWSTR DllName = NULL;
DWORD ReturnCode;
+ int argc;
LPWSTR *argvW = NULL;
- /* overwrite the command line */
+ /* parse the command line */
process_args( GetCommandLineW(), &argc, &argvW );
/*