"Executable created"

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
marcoagpinto
Addict
Addict
Posts: 1045
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

"Executable created"

Post by marcoagpinto »

Fred?!

There is a need to show in the status part when one creates an executable:
"05:28 Executable created"

because sometimes I can't tell if I saved a newer executable over the old one.
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: "Executable created"

Post by coder14 »

You could check the modified date of the exe file properties. :D
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: "Executable created"

Post by DarkDragon »

coder14 wrote:You could check the modified date of the exe file properties. :D
That would be different already at the first byte written to it. It would not tell whether or not the creation has finished. There should really be some kind of decent notification.
bye,
Daniel
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: "Executable created"

Post by coder14 »

DarkDragon wrote:
coder14 wrote:You could check the modified date of the exe file properties. :D
That would be different already at the first byte written to it. It would not tell whether or not the creation has finished. There should really be some kind of decent notification.
Then it should be "Executable created successfully!" :D
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: "Executable created"

Post by Mistrel »

Compilation is so fast though that compilation will be done by the time he brings his file explorer into the foreground.

But if you're compiling anything that has complex dependencies then you would want to move to command line compiling, imo. Compilation is I/O blocking so you'll know that it's done once the process ends.
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: "Executable created"

Post by Marc56us »

2 Solutions:

File > Preferences > Debugger > [X] Display Timestamp in Error log

Log show:
[08:25:06] Waiting for executable to start...
[08:25:06] Executable type: Windows - x86 (32bit, Unicode)
[08:25:06] Executable started.
(That mean new EXE is created at 08:25:06)

Another solution: Make a little program that display message box with and time of exe

Sample:
(Edit: new version OK)

Code: Select all

EnableExplicit

Define EXE_Name$         = ProgramParameter(0)
Define EXE_Timestamp$    = FormatDate("%dd/%mm/%yyyy - %hh:%ii:%ss", 
                                      GetFileDate(EXE_Name$, #PB_Date_Modified))

MessageRequester("Info", "EXE: " + EXE_Name$ + #CRLF$ + EXE_Timestamp$)
Tool configuration:

Commandline: <your exe>
Arguments: %EXECUTABLE
...
...
Event to trigger the tool: After Compile/run

(on right)
[X]Wait until tool quits
Last edited by Marc56us on Fri Dec 16, 2016 11:26 am, edited 1 time in total.
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: "Executable created"

Post by DarkDragon »

Mistrel wrote:Compilation is so fast though that compilation will be done by the time he brings his file explorer into the foreground.
Depends on your output device. On SD Cards or USB Sticks the output might be a bit slow. Also for big projects it must be slower than for small projects.
Marc56us wrote:2 Solutions:
These are workarounds and no solutions. I would move this topic to bug reports in all OS.
bye,
Daniel
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: "Executable created"

Post by Marc56us »

marcoagpinto wrote:There is a need to show in the status part when one creates an executable:
"05:28 Executable created"
because sometimes I can't tell if I saved a newer executable over the old one.
DarkDragon wrote:I would move this topic to bug reports in all OS.
This is not a bug, this is a feature request, so still good here in "Feature Requests and Wishlists" (IMHO)

:wink:
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: "Executable created"

Post by DarkDragon »

Marc56us wrote:
DarkDragon wrote:I would move this topic to bug reports in all OS.
This is not a bug, this is a feature request, so still good here in "Feature Requests and Wishlists" (IMHO)
Do you know the halting problem? I see a similarity between this and the humans sitting in front of the executable.
In usability engineering courses one would learn to show progress to the user, otherwise he might forget what he wants to do afterwards because he starts thinking about when it will end.
bye,
Daniel
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: "Executable created"

Post by Dude »

Marc56us wrote:File > Preferences > Debugger > [X] Display Timestamp in Error log
That doesn't do anything when you're creating a final executable, which was the request.
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: "Executable created"

Post by Marc56us »

Dude wrote:
Marc56us wrote:File > Preferences > Debugger > [X] Display Timestamp in Error log
That doesn't do anything when you're creating a final executable, which was the request.
You're right,
but a bug is something that blocks a program or do error(s)

:idea: Apart from small programs, always work with the project manager (even with one single source file)
The project manager displays more information than the IDE on its own.
You can't do anything else in IDE until compilation (create EXE) ended. This is the safety way.

What's missing is a confirmation message when the EXE already exists and will be overwrited
(yes, here, there is a bug)
And still, not really a bug since it does not block, but there should be a messagebox.
Last edited by Marc56us on Fri Dec 16, 2016 12:02 pm, edited 1 time in total.
User avatar
TI-994A
Addict
Addict
Posts: 2704
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: "Executable created"

Post by TI-994A »

Marc56us wrote:What's missing is a confirmation message when the EXE already exists and will be overwrited...
This behaviour exists on OSX. :wink:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 796
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: "Executable created"

Post by Zebuddi123 »

Hi to all Executable creation notification tool, only tested on windows 10.

Maybe of interest/use to some.

Tool paramaters

Arguments: %EXECUTABLE
Hide from tool menu: Checked
Event to trigger the tool: After executable created.

Zebuddi. :)

Image

Code:

Code: Select all

CompilerSelect #PB_Compiler_Processor
	CompilerCase #PB_Processor_x86
		Structure MY_NOTIFYICONDATA
			cbSize.l
			hwnd.i
			uId.l
			uFlags.l
			uCallbackMessage.l
			hIcon.i
			szTip.s{128}
			dwState.l
			dwStateMask.l
			szInfo.s{256}
			StructureUnion
				uTimeout.l
				uVersion.l
			EndStructureUnion
			szInfoTitle.s{64}
			dwInfoFlags.i
			guidItem.GUID
			hBalloonIcon.i
		EndStructure
	CompilerCase #PB_Processor_x64
		Structure MY_NOTIFYICONDATA
			cbSize.l
			PB_Alignment1.b[4]
			hWnd.i
			uID.l
			uFlags.l
			uCallbackMessage.l
			PB_Alignment2.b[4]
			hIcon.i
			szTip.s{128}
			dwState.l
			dwStateMark.l
			szInfo.s{256}
			StructureUnion
				uTimeout.l
				uVersion.l
			EndStructureUnion
			szInfoTitle.s{64}
			dwInfoFlags.l
			guidItem.GUID
			hBalloonIcon.i
		EndStructure
CompilerEndSelect

ExeFile.s 	= ProgramParameter(0)

Procedure.s GetMachineArchHack(file.s) 
	Protected dos_stub_end
	If ReadFile(0,file)
		FileSeek(0,$84)
		pe_mach_arch.s = ReadString(0, #PB_Ascii)
		CloseFile(0)
		If Len(pe_mach_arch) > 0 
			If pe_mach_arch = Chr(76) + Chr(1) + Chr(5)
				ProcedureReturn "x86"
			ElseIf  pe_mach_arch = Chr(100) + Chr(8224) + Chr(6) 
				ProcedureReturn "x64"
			Else
				ProcedureReturn "Unknown machine type."
			EndIf
		Else
			ProcedureReturn "Failed to read Machine Architecture. "
		EndIf
	EndIf
EndProcedure

If Len(ExeFile) > 0 
	
	If Bool(FindString(ExeFile, "PureBasic_Compilation")) = #False
		
		LoadImage(0, #PB_Compiler_Home + "\Examples\Sources - Advanced\Waponez II\Waponez.ico")
		
		ni.MY_NOTIFYICONDATA
		ni\cbSize = SizeOf(MY_NOTIFYICONDATA)
		ni\uID = 10
		ni\uFlags = #NIF_ICON| #NIF_INFO | #NIF_MESSAGE |#NIF_TIP
		ni\hIcon  = ImageID(0)
		ni\uCallbackMessage = #WM_NOTIFYICON
		ni\uTimeout = 10
		ni\uVersion = #NOTIFYICON_VERSION
		ni\szInfoTitle =  GetMachineArchHack(ExeFile) + "  Executable Created"
		ni\dwInfoFlags = #NIIF_INFO
		
		Shell_NotifyIcon_(#NIM_ADD, ni)
		ni\szInfo = "Compilation of    " + GetFilePart(ExeFile) + "   Complete " + #CRLF$ + FormatDate("%dd/%mm/%yyyy - %hh:%ii:%ss", GetFileDate(ExeFile, #PB_Date_Modified)) + #CRLF$ +"OK."
		Shell_NotifyIcon_(#NIM_MODIFY, ni)
		
		Shell_NotifyIcon_(#NIM_DELETE, ni)
	EndIf
	
EndIf

End
Last edited by Zebuddi123 on Fri Dec 16, 2016 8:52 pm, edited 2 times in total.
malleo, caput, bang. Ego, comprehendunt in tempore
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: "Executable created"

Post by DarkDragon »

Marc56us wrote:
Dude wrote:
Marc56us wrote:File > Preferences > Debugger > [X] Display Timestamp in Error log
That doesn't do anything when you're creating a final executable, which was the request.
You're right,
but a bug is something that blocks a program or do error(s)
And blocking the user is not a bug? I mean the user won't know when it is finished. He can only guess it. There is no deterministic way for a usual user to tell whether or not the creation has finished. In theory he could wait an infinite amount of time and never get a hint that it is finished. At least not without external tools.

Halting problem.
bye,
Daniel
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: "Executable created"

Post by Mistrel »

DarkDragon wrote:There is no deterministic way for a usual user to tell whether or not the creation has finished.
When I compile I get that popup with the progress bar. Does this not include the time it takes to write the executable to disk?
Post Reply