TailBite V1.4.2 Windows

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

This will only work if TailBite is installed in the purebasic directory :?
Here´s my version :

Code: Select all

;/ PureBasic 4.10 
Procedure.s SpecialFolder(folderno)
  Protected listptr,Result$
  listptr=0 
  Result$=Space(#MAX_PATH) 
  SHGetSpecialFolderLocation_(0,folderno,@listptr) 
  SHGetPathFromIDList_(listptr,@Result$) 
  ProcedureReturn Trim(Result$) 
EndProcedure

Procedure.s PBVersion() ; Lance PB /VERSION 
  If OSVersion()>=#PB_OS_Windows_Vista 
    subkey.s="PureBasic.exe\DefaultIcon\" 
  Else 
    subkey.s="Applications\PureBasic.exe\DefaultIcon\" 
  EndIf 
  
  RegOpenKeyEx_(#HKEY_CLASSES_ROOT,@subkey,0,#KEY_READ,@keyhandle) 
  Out.s=Space(255) 
  DataSize.l=Len(Out) 
  RegQueryValueEx_(keyhandle,@name$,0,@Type,@Out,@DataSize) 
  RegCloseKey_(keyhandle) 
  
  Out=StringField(Out,1,",") 
  Out=GetPathPart(Out)+"Compilers\PBCompiler.exe" 
  
  pid=RunProgram(Out,"/version","",#PB_Program_Open|#PB_Program_Read|#PB_Program_Hide) 
  If pid 
    While ProgramRunning(pid) 
      Sortie.s + ReadProgramString(pid) + #CRLF$ 
    Wend 
  EndIf 
  Sortie=StringField(Sortie,1,Chr(13)) 
  
  ProcedureReturn Sortie 
EndProcedure 

Procedure.s TBVersion() ; Lance TB /VERSION 
  TBPreferencesPath$=SpecialFolder(#CSIDL_APPDATA) + "\TailBite\"
  PBVersion$ = UCase(PBVersion())
  PBVersion$ = RemoveString(PBVersion$, "PUREBASIC")
  PBVersion$ = RemoveString(PBVersion$, "WINDOWS")
  PBVersion$ = RemoveString(PBVersion$, "X86")
  PBVersion$ = RemoveString(PBVersion$, "(")
  PBVersion$ = RemoveString(PBVersion$, ")")
  PBVersion$ = RemoveString(PBVersion$, "-")
  PBVersion$ = RemoveString(PBVersion$, "V")
  PBVersion$ = Trim(PBVersion$)
  PBnbVersion=Val(RemoveString(PBVersion$,"."))
  If PBnbVersion
    TBPreferencesPath$=TBPreferencesPath$+"TailBite_"+Str(PBnbVersion)+".prefs"
  Else
    TBPreferencesPath$=TBPreferencesPath$+"TailBite.prefs"
  EndIf
  If OpenPreferences(TBPreferencesPath$)
    Out.s=ReadPreferenceString("TBFolder","")+"TailBite.exe"
    pid=RunProgram(Out,"/version","",#PB_Program_Open|#PB_Program_Read|#PB_Program_Hide) 
  EndIf
  If pid 
    While ProgramRunning(pid) 
      Sortie.s + ReadProgramString(pid) + #CRLF$ 
    Wend 
    Sortie=StringField(Sortie,1,Chr(13)) 
    ProcedureReturn Sortie 
  EndIf 
EndProcedure 

MessageRequester("Version","PureBasic : "+PBVersion()+#CRLF$+"Tailbite     : "+TBVersion())
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

thanks i take a look @ your code :wink:
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

New Version is out :
[34] APR 21th 2008 TailBite v1.3 PR 1.872
- fixed varalias bug (reported by LNA)
- fixed detection of modifiers (reported by Mistrel)
- switched to new sourcecode ordering (Thanks to Progi1984)
Regards Klaus
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Thank you for the update, ABBKlaus. :)
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

New version is out :
[35] APR 22th 2008 TailBite v1.3 PR 1.873
- fixed creation of resident (reported by ts-soft)
Regards Klaus
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

New version is out :
[37] MAI 25th 2008 TailBite v1.3 PR 1.875
- fixed PureBasic PB4.20 final problem with pb_align / pb_bssalign = align (macro´s are the same)
- improved GetPBFolder() reads uninstall information to determine PureBasic installation path (thanks to mistrel)
PS:
as a side effect the folder-detection does only work for PB4.20, not the older versions.
If backward compatibility is wanted you should install TailBite in separate folders and put the appropriate 'tailbite.prefs' file in it.

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

Post by Mistrel »

I just compiled PureGDK (126 libs) with TailBite 1.875 for PureBasic 4.20 and it works great.

Thank you, ABBKlaus!

I'm not sure what you're using now to identify the PB directory that's not backwards compatible. I've revisited my lookup commands if you would like to take any part of the changes:

http://www.purebasic.fr/english/viewtop ... 334#245334
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

With the latest version, TBManager ignores the folder I select to have the generated ASM files stored in! It always sticks them in MyDocuments etc.
I may look like a mule, but I'm not a complete ass.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

@mistrel : both registrykeys are present now, its impossible to know which one is the right.

@srod : the change in 'Asm source folder:' is only saved if you hit the 'Save' button :wink:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Doh! :oops:

hehe
I may look like a mule, but I'm not a complete ass.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

I just uploaded a new test-version : http://www.tailbite.com/downloads/TailB ... R1.876.zip

I make it final if someone says it works :twisted:
[38] MAI 27th 2008 TailBite v1.3 PR 1.876
- fixed GetPBFolder (thanks to ts-soft)
- fixed string bug in exported functions RET X + 4 (thanks to Fred / srod / gnozal)
Note from Gnozal : don't use exported string functions in the library
Example that crashes on MySecondProcedure() :

Code: Select all

ProcedureDLL.s MyProcedure()
  ProcedureReturn "TEST"
EndProcedure

ProcedureDLL.s MySecondProcedure()
  ProcedureReturn MyProcedure() ; <- will crash
EndProcedure
Safe example :

Code: Select all

Procedure.s MyLocalProcedure()
  ProcedureReturn "TEST"
EndProcedure

ProcedureDLL.s MyProcedure()
  ProcedureReturn MyLocalProcedure()
EndProcedure

ProcedureDLL.s MySecondProcedure()
  ProcedureReturn MyLocalProcedure()+"1"
EndProcedure
Last edited by ABBKlaus on Tue May 27, 2008 11:37 pm, edited 1 time in total.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

> @mistrel : both registrykeys are present now, its impossible to know which one is the right.

This is only on XP:
4.20 use HKEY_CURRENT_USER now due to some problems with admin accounts. (so it is the same as on Vista)
So the key in HKEY_CLASSES_ROOT is probably left from a 4.10 version.

I will add some code to clear the HKEY_CLASSES_ROOT location (if possible) in the future.
quidquid Latine dictum sit altum videtur
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

1.876 works great. I think the problem is fixed. :)
Note from Gnozal : don't use exported functions in the library
Would you give an example of this?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

At the moment you should not have a function inside your library calling an exported string function inside the same library. Avoid this and (Klaus' fix withstanding! :wink: ) you should be okay.
I may look like a mule, but I'm not a complete ass.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Thanks for testing. Just uploaded the new version.
I made some examples of how it crashes and how it should be done the safe way.

@Freak : does this mean you will be releasing a bugfix version 4.21 :P
[38] MAI 27th 2008 TailBite v1.3 PR 1.876
- fixed GetPBFolder (thanks to ts-soft)
- fixed string bug in exported functions RET X + 4 (thanks to Fred / srod / gnozal)
Note from Gnozal : don't use exported string functions in the library
Forum thread : http://www.purebasic.fr/english/viewtop ... 189#230189
Post Reply