News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Project Builder

Started by The Freak, May 25, 2008, 06:12:34 PM

Previous topic - Next topic

The Freak

Project Builder, Ver. 1.1.0
---------------------------
I have no doubt that many people who populate this board can probably make a better product to do this job, please do not make this a competition. I left this board once before and never had any intentions of returning because of certain people. I have decided to restrain my bitterness and try again ...

Evaluate the tool for what it is and honestly tell me if it is useful.
-- the freak

What is the Project Builder:
---------------------------
This tool is used to build WINDOWS or CONSOLE TYPE Projects. The idea of its use is to keep it running in the background while using the editor of your choice to build your source code. At any given point you can use ALT+TAB to move this tool to the foreground and do a test build. This process can be repeated over and over again until you achieve the desired result - a working Windows Program. Actually, you can be working on many projects at the same time and use this same Console to test build them. The output of the build tools are preserved in the window so that at any point you can go back and review them. Copy and Paste work and the output can be saved to a text file. Any output that is saved will be appended to a file named [Project Name].log.

The Assembly Source file(s):
---------------------------
The user is prompted to choose the assembly source file and the builder will use that file name to determine the names of all other files used in the build process. The only exception to this hard and fast rule is if the resource file is named RSRC.RC in which case, RSRC.RES will be created and used during the build process. If there is more than one assembly source file, the additional files need to be handled by the main source file.

The Resource file(s):
---------------------------
The program will use the filename of the assembly source file to create the resource filename that will be used. If it turns out that such a file does not exist, a test will be done to see if there is a file named RSRC.RC and, if so, will use that filename to create the .RES file. If a resource file of either name is found, it will be linked. If there is more than one resource file, the additional files need to be handled by the main resource file.

Tools:
---------------------------
I am using ML.EXE, RC.EXE and LINK.EXE for the moment as they are very stable. Other tools may be just as stable but they are aftermarket tools and, as such, need to have their worth proven over time. These tools can be obtained in many different places, I guess; but the only ones that I trust to be used LEGALLY are found in the MASM32 and GeneSys SDKs. This utility will decide which of these two SDKs is is used to build with. The method that is employed is that, if \GeneSys\bin\ml.exe exists; GeneSys will be used. Otherwise, a search for \masm32\bin\ml.exe  will be performed and, if found, it will be used. If neither folder exists, this utility will not function.

ProjectBuilder.exe
---------------------------
A hard and fast requirement is that ProjectBuilder.exe MUST be run from the same harddrive that holds ml.exe. However, projects can exist and be built from ANY harddrive in your system.

Technical Notes:
----------------
There are many versions of Windows that are still in use today. For our purposes, here, there is only one thing that is important; the command shell that will be used by Console type applications. Since cmd.exe is the better shell for many reasons, if it exists; this application will always use it. Otherwise, command.com will be used. In either case, the '/k' switch is being used so that the instance of the command shell will remain active even after the program exits so that the user can see any output to STDOUT.

The log file:
--------------
In the process of building a project the various tools will direct output of some sort to the active console. Errors along with the pertinent line numbers are very important as an aid to the user in the creation process. For this reason, I have included a log file that the user can use to save this information. Text is ALWAYS APPENDED to this file so it will continue to grow over time. Since each project is in its own folder, each project has its own log file. Even though there is no limit to the size of this file (beyond the limitations of the OS), there IS a limit to the size of the data that can be saved to it at any given instance. This size is 8K which is more than adequate as the amount of data written during any given build is really not so large.

When the user empties the console output to the log file, the console window is cleared. However, the data is also written to the clipboard so if you accidentally empty the console window, you can press CTRL+V to put it back. I am wondering if I should look for a log file in the project folder and if it already exists, copy its contents into the console window once the project has been identified. For my purposes, this is not needed but if others want it, I will do it.

NOTE: The console window operates like an edit window so the user can type in notes at various places before saving it to the log file so that ideas will not be forgotten. This is a feature I cannot live without! I am entertaining the thought of increasing the edit capabilities of the console and providing a mechanism to swap from edit mode to build mode. If I do this, the user will be prompted for a filename in the traditional manner during the File, Save process. Please tell me what YOU think.

Imperfect World
--------------
There is one thing that I am unsure how to deal with in regards to the log file and I welcome suggestions. The problem[?] is in regards to using the console to develop multiple projects. Currently, if you decide to save the log file it will be saved in the folder of the last project built [using that project's name. This is not what I would consider to be clean programming.

I am thinking of setting a flag when multiple projects are built. If the flag is set, then the data would be appended to a file called ProjectBuilder.log and could be located in the Root of the drive containing ml.exe or in the same folder as ml.exe

Any thoughts would certainly be seriously considered as I want this tool to be useful.


[attachment deleted by admin]

Vortex

Thanks for this tool. Trying to buid a GeneSys project, I received the following error messages :

.
.
.
Automated Build Process commencing ...


Calling the Assembler.

Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: D:\GeneSys\examples\CursorExample\Dialog.asm

Assembly completed successfully.


Calling the Compiler.

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.


Using codepage 1254 as default
Creating rsrc.RES

RC: RCPP -CP 1254 -f D:\GeneSys\examples\CursorExample\RCa03980 -g D:\GeneSys\examples\CursorExample\RDa03980 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I .

rsrc.rc.
Writing DIALOG:MYDIALOG, lang:0x409, size 226

Errors occurred while compiling. The Build process is halted.


Calling the Linker.

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


The executable was successfully created.



The example I selected :

Quote\GeneSys\examples\CursorExample

Looking at the project directory, I can see the files below :

Build.bat
Dialog.asm
Dialog.exe
Dialog.obj
rsrc.rc
rsrc.RES


The executable is created but Windows does not display the dialog box.

hutch--

Freak,

The tool works fine on a set of console EXE test pieces I have built recently. It recognises the correct assembler and linker and the results all run OK.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

PBrennick

Hutch,
Thanks for testing. In fact, the Console option in the GenSys editor is something that I was never happy with which is why some debugging windows were left in the executable. This code will eventually make its way there after some more testing.

Vortex,
I see this also. It is very interesting and needs to be looked into. I will let you know what I discover. as soon as I get a better connection to the Internet, I will send the sources to you and eventually we will have to decide if it should become open source.

In the meantime I will fix the thing where an executable is being created with just the asm file if the rc file craps out. The error report is a pain as it is not telling me much even though I am using the /v switch. For test purposes, I will switch to porc.exe to see if it is more helpful. It may be a memory error, also...

Hi guys,
Paul
The GeneSys Project is available from:
The Repository or My crappy website

PBrennick

Vortex,
As usual, it winds up being a silly mistake (in the logic train). Download the attachment in this message and continue testing please ...

Paul


[attachment deleted by admin]
The GeneSys Project is available from:
The Repository or My crappy website

Vortex

Hi Paul,

I tried the new version but it does not build the project I mentinoned above :

QuoteAutomated Build Process commencing ...


Calling the Assembler.


Errors occurred while assembling. The Build process is halted.


Errors occurred while assembling. The Build process is halted.


I runned the tool after deleting the intermediate files. Project Builder should be able to display the exact error messages reported by ml.exe, link.exe and rc.exe

PBrennick

Vortex,

Since I am not sitting at your machine, I cannot know what is going on. This is the output that I get ...

Project Builder, Version 1.1.0
------------------------------
Developed and released to the members of this Board.
By The GeneSys Team.

Please select Build and then Assemble, first, so as to set
the filenames that will be used by the Project.


Automated Build Process commencing ...


Calling the Assembler.

Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: D:\GeneSys\examples\CursorExample\Dialog.asm

Assembly completed successfully.


Calling the Compiler.

\GeneSys\bin\rc.exe /v rsrc.rc

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.


Using codepage 1252 as default
Creating rsrc.RES

RC: RCPP -CP 1252 -f D:\GeneSys\examples\CursorExample\RCa02544 -g D:\GeneSys\examples\CursorExample\RDa02544 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I .

rsrc.rc.
Writing DIALOG:MYDIALOG, lang:0x409, size 226

Compilation completed successfully.


Calling the Linker.

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


The executable was successfully created.




Since I do not see at least the following ...

Calling the Assembler.

Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: D:\GeneSys\examples\CursorExample\Dialog.asm


... I am a bit confused. I really can't say what is happening there. Also, if ml.exe, rc.exe or link.exe are never called, you will not get any output from them???

I use nothing else to build any of my programs any longer and the fact, as stated in the docs, that aqll errors are shown and can be saved to a log file has been indispenceable.

The only change I have made between the version you are using and the one I am using is the word 'Freak' has been replaced. Please bundle the executable and email it to me.
Paul

Paul
The GeneSys Project is available from:
The Repository or My crappy website

PBrennick

I just downloaded the latest posting I made just in case I screwed something up. It works fine.

MichaelW,
Would you please be willing to download the latest version and use it to build the CursorExample in the GeneSys Project?

Please remember the drive limitation as stated in the docs. ProjectBuilder.exe and the target project MUST reside on the same drive.

I await some help here.
Paul
The GeneSys Project is available from:
The Repository or My crappy website

MichaelW

With the old version I got:

Project Builder, Version 1.1.0
------------------------------
Developed and released to the members of this Board.
By The Freak.

Please select Build and then Assemble, first, so as to set
the filenames that will be used by the Project.


Automated Build Process commencing ...


Calling the Assembler.

Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: C:\GeneSys\examples\CursorExample\Dialog.asm

Assembly completed successfully.


Calling the Compiler.

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.


Using codepage 1252 as default
Creating rsrc.RES

RC: RCPP -CP 1252 -f C:\GeneSys\examples\CursorExample\RCa01212 -g C:\GeneSys\examples\CursorExample\RDa01212 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I .

rsrc.rc.
Writing DIALOG:MYDIALOG, lang:0x409, size 226

Errors occurred while compiling. The Build process is halted.


Calling the Linker.

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


The executable was successfully created.


And the EXE would not run. I tried deleting the EXE and object module before starting the build process, and the results were the same. With the new version I get:

Project Builder, Version 1.1.0
------------------------------
Developed and released to the members of this Board.
By The Freak.

Please select Build and then Assemble, first, so as to set
the filenames that will be used by the Project.


Automated Build Process commencing ...


Calling the Assembler.

Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: C:\GeneSys\examples\CursorExample\Dialog.asm

Assembly completed successfully.


Calling the Compiler.

\GeneSys\bin\rc.exe /v rsrc.rc

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.


Using codepage 1252 as default
Creating rsrc.RES

RC: RCPP -CP 1252 -f C:\GeneSys\examples\CursorExample\RCa02008 -g C:\GeneSys\examples\CursorExample\RDa02008 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I .

rsrc.rc.
Writing DIALOG:MYDIALOG, lang:0x409, size 226

Compilation completed successfully.


Calling the Linker.

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


The executable was successfully created.


And the exe runs correctly.
eschew obfuscation

hutch--

Paul,

The technique I use for this type of task is to do a test for the existence of both the EXE/DLL and the object module that it is linked from, delete them both as a CLEAN operation and them do the build in the normal manner. You can then test if the EXE/DLL and OBJ module were created, even pipe the results to a display if you want and it should solve the problem.

This is looking like a good capacity that would work well in your GeneSys editor.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

PBrennick

Hutch,
I guess I will do just that. I am already testing for their existence, but I left the clean up for the user to decide. The reason that I did it that way, really, was so that when NOT using the automated method a user with an existing .RES file could click Assemble and then click Link thereby re-using the already existing resource file.

Question, I am certain that I will do it just as you say when a user is using the BUILD command. Should I, also, do this when using the step-by-step method. If I do it that way, I would just do a clean up at the start of the assembly process and remove the manual clean up menu item.

I have a lot going on in this program, a lot of string manipulation so I have been VERY careful to listen to everyone, especially if they notice something odd. Crossbreeding was the only problem I had to figure out because I was determined that this should be a Console that should always run in the background to build any and all projects.

Thanks for the advice and please let me know what you would suggest about the cleaning feature.

MichealW,
As always, thank you for all your help.

Vortex,
Are you still having problems, my friend?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

hutch--

Paul,

The idea that I personaly like is to have 4 options, compile the RC file into a RES file, assemble alone which is useful when making libraries, link alone which gives the programmer the seperate control if they require it and the combined build all that assembles the asm source, compiles the resources then links all of them into an EXE or DLL file. I have usually made the link process detect if a RES file is present them link both the object module and the res file.

With a pseudo menu,
---------------------
Compile RC file to RES
Assembler Object Module
Link Object Module and RES file
Build the complete project.
---------------------

In each instance I would delete all of the files that have to be rebuilt first. the RES file, the object module for the second, the RES file for the third and the forth "build all" option deletes the object module, RES file. This way you always get a clean build that does exactly what you want.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

PBrennick

Sounds like an excellent idea, Hutch. I will do that. One last question (for now):  should I clean up after a successful build?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

hutch--

It may only be a matter of personal taste but I prefer to leave the OBJ and RES files intact so that you have the full set if you just want to tweak something. I would leave the clean operation to the next build.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

PBrennick

The GeneSys Project is available from:
The Repository or My crappy website