https://stackoverflow.com/questions/36332189/inno-setup-run-regsvr32-with-a-specific-working-directory
You cannot. The regsvr32.exe
that Inno Setup runs internally to (un)register DLLs is explicitly run from a system directory (typically the C:WindowsSystem32
).
Your workaround is the best way.
Just add an equivalent [UninstallRun]
entry to unregister the DLL:
[UninstallRun]
Filename: "{sys}
egsvr32.exe"; Parameters: "/u /s Awkward.dll"; WorkingDir: "{app}";
Flags: runhidden;
Or even better, fix the DLL not to rely on a working directory. You can use the LOAD_WITH_ALTERED_SEARCH_PATH
flag for the LoadLibraryEx
.
See also Dynamic-Link Library Search Order.
answered Mar 31 '16 at 11:42