How to add Version Information BlitzMax EXE

BlitzMax Forums/BlitzMax Programming/How to add Version Information BlitzMax EXE

Captain Wicker (crazy hillbilly)(Posted 2012) [#1]
How can I add version information into a blitzmax exe file?

File Version:
Product name:
Product version:
Copyright:


ziggy(Posted 2012) [#2]
This can be done by emvedding a manifest file to the executable, but I don't think BlitzMax does support it nativelly.


Captain Wicker (crazy hillbilly)(Posted 2012) [#3]
How can I emved a manifest in the program ziggy? What is emved? Do you mean embed?


jsp(Posted 2012) [#4]
I could send you some stuff but there is no email in your profile.


Midimaster(Posted 2012) [#5]
you have to write a manifest and a link an *.o file to your bmax code. But you need 4 steps:

I:

write this text with a text editor and save it as ICON.RC in a new directory "C:\TEST\"

1 24 "manifest.manifest"
101 ICON C:\test\icon.ico
1 VERSIONINFO
FILEVERSION 4,0,1,0
PRODUCTVERSION 4,0,1,0
FILEOS 0x40004
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
 BLOCK "040904b0"
 {
  VALUE "Comments", "music theory software"
  VALUE "CompanyName", "Midimaster Music Education Software"
  VALUE "FileVersion", "2012.02.24.0"
  VALUE "FileDescription", "RhythmTrainer"
  VALUE "InternalName", "RhythmTrainer"
  VALUE "LegalCopyright", "© Peter Wolkersdorfer"
  VALUE "LegalTrademarks", "Midimaster"
  VALUE "OriginalFilename", "RhythmTrainer"
  VALUE "ProductName", "RhythmTrainer"
  VALUE "ProductVersion", "4.0.1.0"
 }
}
BLOCK "VarFileInfo"
{
  VALUE "Translation", 0x0407, 0, 0x0409, 0, 0x0405, 0
}
} 

if you do not want to add an icon to your exe remove the line with the ICON.ICO



II:
write this text with a text editor and save it as MANIFEST.MANIFEST also to the "C:\TEST\"

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
   <dependency>
      <dependentAssembly>
         <assemblyIdentity
            type='win32'
            name='Microsoft.Windows.Common-Controls'
            version='6.0.0.0'
            publicKeyToken='6595b64144ccf1df'
            language='*'
            processorArchitecture='*'
         />
      </dependentAssembly>
   </dependency>
</assembly>




III:

write this text with a text editor and save it as MAKEIT.BAT to the same directory :

windres -i C:\test\icon.rc -o C:\test\icon.o


now doubleclick on the MAKEIT.BAT. This will create a ICON.O file in the same directory. Copy this file into the same folder, where your *.bmx file is.



IV:

Now ad this line to your *bmx-code:

SuperStrict
?Win32
	Import "icon.o"
?


Last edited 2012


Captain Wicker (crazy hillbilly)(Posted 2012) [#6]
there is no email in your profile

@jsp:
I was forced to hide my email due to being constantly harassed by three of my fellow blitzers while hoping I wouldn't have anyone else stalking my gmail account. Sorry!

@midimaster:
thanks! that is very helpful! :)
What is a .bmk file? Do you mean .bmx file?

Last edited 2012


jsp(Posted 2012) [#7]
No problem, if you need further help you could mail me.


Captain Wicker (crazy hillbilly)(Posted 2012) [#8]
I followed these instructions but it fails to create the *.o file. I have uploaded a zip file via dropbox with it's contents. What am I doing wrong? http://dl.dropbox.com/u/56193888/TEST.zip


ziggy(Posted 2012) [#9]
I was trying to get the same results by providing the assembly version on the XML file, but I see that adding them to the RC is way better. I'll be adding this to BLIde for the next update.
Captain, I've downloaded your sample and it works properly here, so I think you do not have properly set your MinGW installation. If it is properly set up on BLIde, you can go to tools / Open optimized compiler and write the command gcc to see if it is properly recognized. If it is, you can make this process from within the optimized BLIde console.


Captain Wicker (crazy hillbilly)(Posted 2012) [#10]
Here us the answer! I edit the BAT file and add this at the top:
PATH=C:\mingw\bin;%PATH%

And all works! (so far). Now I have the .o file created! :)


Midimaster(Posted 2012) [#11]
sorry i wrote it very fast... I mean bmx-file (your source code)

if the creating of the *.o file fails it could have some reasons. one is you must have a working MinGW on the computer. A second one is that you should take care about the empty lines and spaces. they are important! Third is, that you remove the line with the ICON.ICO, if you do not have such a file

[EDIT]
ah... good ... congratulations.

now start to play with the parameters in the given ICON.RC text and replace tit with your informantions.

Last edited 2012


Captain Wicker (crazy hillbilly)(Posted 2012) [#12]
Great! Ive got my information into my application! :D But can the same be done with Blitz3D? :/


col(Posted 2012) [#13]
Hiya,

It would be nice if the MaxIDE supported a pre-build process, does BLIde have a pre-build feature? Or is there a way to get a feature without making your own bmk?


SystemError51(Posted 2012) [#14]
Thanks for this. The information here is relevant for my project as well.


Midimaster(Posted 2012) [#15]
@col
sorry for writing "*.bmk". this was only a typo! You need no new bmk. I mean "*.bmx" !!! a normal code file...


col(Posted 2012) [#16]
@col
sorry for writing "*.bmk". this was only a typo! You need no new bmk. I mean "*.bmx" !!! a normal code file...



Yeah, no worries, Sorry for the confusion - I understood what you meant :P

With 'bmk', I meant the bmk.exe file inside the BlitzMax/bin folder. It works like a traditional 'make' file compiling the source files into object files using the correct compiler according to the source code file extension, and also 'acts' as a linker to bring them together for the final exe, again using the correct tools.

What I meant was a 'pre-build' phase, in that you could run other .exes during the compilation process and before it builds your own .exe. Using your example in post #5 above, in a pre-build phase you would have the windres.... command run when you hit Compile, so everything is done in an 'all-in-one' process. A pre-build is usually just a list of command line prompts anyway etc.

I wasn't sure if the standard bmk.exe file was capable of doing this or if it would need modifying ( we have the source in the BlitzMax/src folders ).


ziggy(Posted 2012) [#17]
BLIde does support automatical .o resource compilation to embed icons to executables and enable visual styles. Next version will support all the features described here too (currently testing), among other small improvements. Heopefully this will be out in a couple of weeks, but you know how beta-testing is, it may take a bit longer or a bit shorter.


col(Posted 2012) [#18]
Hiya ziggy,

During compilation, I'd like to be able to run a command line that will generate a new .o file everytime. This new .o will be imported into the current source thats compiling. Is that possible with BLIde or an upcoming feature?

Sorry just reread you previous post :D
Cool, look forward to the feature, I'll buy it when that feature is present. Nice one!

Last edited 2012


ziggy(Posted 2012) [#19]
That's been added to latest BLIde release.