Page 1 of 1

Improvement to GetPBFolder()

Posted: Sat May 10, 2008 9:28 am
by Mistrel
GetPBFolder() will fail if the .pb file association has not been made yet (on first run of PureBasic.exe).

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

Posted: Thu May 15, 2008 5:33 pm
by ABBKlaus
thanks i will add that in the next version.