Vincent BĂ©ron wrote:
Note: Much functionnality is still absent, but it's already able to begin the installation of iTunes.msi and netfx.msi. I plan on updating this in the coming days.
Nice work.
Changelog: First draft for a msiexec.exe replacement.
Vincent
...
printf("Dll %s does not implement function %s\n", DllName, ProcName);
Minor nitpick: this (and similar messages) should be fprintf(stderr,...)
+static void DllRegisterServer(LPCSTR DllName) +{
- HRESULT hr;
- DLLREGISTERSERVER pfDllRegisterServer = NULL;
- HMODULE DllHandle = NULL;
- pfDllRegisterServer = LoadProc(DllName, "DllRegisterServer", &DllHandle);
- hr = pfDllRegisterServer();
- if(FAILED(hr))
- {
printf("Failed to register dll %s\n", DllName);
ExitProcess(1);
- }
- printf("Successfully registered dll %s\n", DllName);
- if(DllHandle)
FreeLibrary(DllHandle);
+}
+static void DllUnregisterServer(LPCSTR DllName) +{
- HRESULT hr;
- DLLUNREGISTERSERVER pfDllUnregisterServer = NULL;
- HMODULE DllHandle = NULL;
- pfDllUnregisterServer = LoadProc(DllName, "DllUnregisterServer", &DllHandle);
- hr = pfDllUnregisterServer();
- if(FAILED(hr))
- {
printf("Failed to unregister dll %s\n", DllName);
ExitProcess(1);
- }
- printf("Successfully unregistered dll %s\n", DllName);
- if(DllHandle)
FreeLibrary(DllHandle);
+}
...
- ExitProcess(0);
- return 0;
+}
The ExitProcess call should not be needed.
Rob