I am trying to create an inno setup installer that fixes a previous installation, but I cannot force the installer to determine the path where my previous installation was. I tried to use the function DefaultDirName={reg:HKxx\SubkeyName,ValueName|DefaultValue} from inno, but I'm not sure what to add to the place of DefaultValue. How can i do this?
Edit: I also tried this part:
[Setup] DefaultDirName={code:GetPathInstalled} [Code] function GetPathInstalled (Param: String): String; var Country: String; begin RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\JoWooD\Painkiller Resurrection', 'Install', Country); end;
But when I run the installer, the path is empty.
source share