List,
I am trying to invoke stampinf and reuse the version information from a header file in the project. The fewer places to maintain the version number the better, right?
Therefore, I want to create the STAMPINF_VERSION environment variable before I execute the stampinf utility. As you know, the variable is an alternative to specifying a version using -v on the command line.
I have set up a “post build step” by specifying NTTARGETFILE2=post_build_sign in my SOURCES file. The implementation has so far been varied but unsuccessful.
1-- From inside the post build step I tried to generate an include file that would be included and set the variable. Thanks to Mr. Cattley for the idea in this thread: http://www.osronline.com/showThread.cfm?link=151398
If I use only one block in makefile.inc I seem unable to mix !commands with commands that should be executed (copy, stampinf, etc). So I had to use two blocks, where my post_build_sign became dependent on another block that would generate and include the new include file. The problem is the second block seems to have its own variable scope because the variable is created successfully, but when returning to post_build_sign it no longer exists.
2-- I discovered a command that works well when used from a regular command prompt, and reads the variable value from a file, but completely fails when used in makefile.inc
C:\>set /P STAMPINF_VERSION=dummy < file
When used in makefile.inc the variable “/P STAMPINF_VERSION” is created with a value of “dummy < file”. How useful…
3-- Generate a batch file instead and call it right before i invoke stampinf. This has the same problem as #1 in that the variable is created but once execution returns from the call, the variable is wiped.
4-- Generate a batch file that also runs stampinf after it creates the variable. This should work but I am experiencing some weirdness ![]()
From makefile.inc
copy “$(OBJ_PATH)\stampinf.template” “$(OBJ_PATH)$(O)\stampinf.template” /y >nul
copy “$(OBJ_PATH)$(O)\stampinf.bat” + “$(OBJ_PATH)$(O)\stampinf.template” /y >nul
The appended file is then created as “$(OBJ_PATH)\stampinf.bat” with an extra 0x1A character at the end. How is this possible?
I probably tried more things but those are the ones I can think of. Please let me know if you have had better success at solving the same problem.
Best regards,
Otto