Page 1 of 1

Small bug with jaPBe and PB 4.10 b.

Posted: Sun Oct 07, 2007 11:03 am
by Chris
There is a small bug with jaPBe and version 4.10 beta 2 or beta 3 of PureBasic.
At each compilation, a program named Purebasicxxx.exe is created in the temporary folder "C:\Documents and Settings\YourName\Local Settings\Temp", but this program is not deleted when jaPBe is closed.

After some time, it can make a lot of programs, and therefore, a lot of useless megabytes in this folder.

I have created a plugin who delete the temporary files when jaPBe is closed.

Compile this code as "TmpRemover.exe" (or another name), put the exe in the folder "plugins", then restart jaPBe.

Choose "TmpRemover Plugin" in the menu "Tools - Config tools", and choose "jaPBe End" in "Trigger".

The temporary files will be deleted each time jaPBe is closed.

(Text translated from the French by a software. sorry ) :wink:

Code: Select all

;-Global
Global jaPBe_Handle
Global jaPBe_Version

#timeout=5000
#mywm_Plugin_Cancel = #WM_USER+18

If OpenWindow(1,0,200,200,200,"jaPBe-Plugin",#PB_Window_Invisible)
  a$=ProgramParameter()
  If a$="jaPBe"
    jaPBe_Handle = Val(ProgramParameter())
    jaPBe_Version$ = ProgramParameter()
    
    If ExamineDirectory(0, GetTemporaryDirectory(), "*.exe")  
      While NextDirectoryEntry(0)
        If DirectoryEntryType(0) = #PB_DirectoryEntry_File
          If FindString(LCase(DirectoryEntryName(0)), "purebasic", 1)
            DeleteFile(GetTemporaryDirectory() + DirectoryEntryName(0))
          EndIf
        EndIf
      Wend
      FinishDirectory(0)
    EndIf
    
    PostMessage_(jaPBe_Handle,#mywm_Plugin_Cancel,0,WindowID(1))
  Else
    MessageRequester("jaPBe Plugin","This is a jaPBe-Plugin"+Chr(10)+"You can't run it without jaPBe",0)
  EndIf
  CloseWindow(1)
Else
  MessageRequester("jaPBe Plugin","Can't open a window!",0)
EndIf

End

Posted: Mon Oct 08, 2007 3:41 am
by Rook Zimbabwe
Excellent work!!! Though I only use the internal IDE I have considered playing afround with JPABE, a silly question... Are you using XP or VISTA?

And whatever translation program you are using seems to be working well! :D

Re: Small bug with jaPBe and PB 4.10 b.

Posted: Mon Oct 08, 2007 8:15 am
by gnozal
Chris wrote:There is a small bug with jaPBe and version 4.10 beta 2 or beta 3 of PureBasic.
At each compilation, a program named Purebasicxxx.exe is created in the temporary folder "C:\Documents and Settings\YourName\Local Settings\Temp", but this program is not deleted when jaPBe is closed.
That's strange, because these temporary EXE files are deleted when jaPBe quits (at least on my PC's).

Code: Select all

Procedure ExitCompiler() ; In Compiler.pbi
  EnableCompilerCommands(#False)
  If CompilerProcessID 
...
    ForEach CreatedCompileRunEXE()
      DeleteFile(CreatedCompileRunEXE())
    Next
...
  EndIf
EndProcedure