Execute/Run the following Inno code and I got error message. The file "c:\xxxx-runtime\unins000.exe" does exist.
Error message:
Unable to execute file:
"c:\xxxx-runtime\unins000.exe"
CreateProcess failed; code 267.
The directory name is invalid.
Inno code shown below:
[UninstallRun]
Filename: "{code:ARGetUninstallString}";
;Filename: {code:ARGetUninstallString}; -- same result
[Code]
function ARGetUninstallString(p: String): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant('Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\xxxx_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKEY_CURRENT_USER, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
However, It works fine IF I replace
[UninstallRun]
Filename: "{code:ARGetUninstallString}";
With
[UninstallRun]
Filename: "c:\xxxx-runtime\unins000.exe";
Would any Inno expert knows what the issue is?