Improvement to GetPBFolder()

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Improvement to GetPBFolder()

Post 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
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

thanks i will add that in the next version.
Post Reply