You can try reading the uninstall information as a failsafe:
Code: Select all
If Not Folder.s
If RegOpenKeyEx_(#HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Uninstall\PureBasic_is1",0,#KEY_ALL_ACCESS,@hKey)=#ERROR_SUCCESS
If RegQueryValueEx_(hKey,@"InstallLocation",0,@Type,Value,@MaxStringSize)=#ERROR_SUCCESS
Folder.s=PeekS(Value)
EndIf
RegCloseKey_(hKey)
EndIf
EndIf