SetVersion

From Bohemia Interactive Community
Jump to navigation Jump to search

SetVersion version 2.xx by Mikero.

see readme general
see fixes




SerVersion changes the RequiredVersion= of any config.cpp/bin within an addon.pbo


It is specifically targetted at (but not limited to) making Arma ONE addons compatible with Arma TWO.


For the most part this will work, because. for the most part, the engine 'understands' the alternate p3d compressions (lzss) inside arma1. And / Or, the p3d models and classes are largely in the same /ca/folder/ network.

As an aside, but, for the removal of some half dozen objects in the arma2 addons, sara, and most missions would have been compatible with a2. There is no readily available upgrade path, rendering all previous efforts and mission creation, redundant. So much for a retaining a loyal customer base.

Secondly, why on earth each revision of the engine from cwc through to arma2 has revision values LESS than previous engines defies all explanation.



Useage

SetVersion [-options] 1.03(eg) SomePbo[.pbo] [AnotherPbo[.pbo]]

options

-x Exclude config.cpp(s) from revision. only revise bin
-p dont pause



note that SetVersion is recursive. It will change ALL config.cpp/bins's encountered in the pbo


Return Values




for Dos usage it is useful to 'know' (via ERRORLEVEL) what operation was performed

0 VERSION_CHANGED: a change took place
1 VERSION_SAME: the RequiredVersion(s) are identical to what was wanted no change to pbo
2 VERSION_NONE: no config(s) (or no RequiredVersion= in those configs) found. no change to pbo
3 VERSION_ERROR: file could not be processed in some way





CAVEAT EMPTOR and ROE (rules of engagement)



Config.cpp

Config.cpp is normally a text file. It can, alternatively be encountered in a binarised form, and to all intents is a config.bin


When config.cpp IS a text file, SetVersion attempts to convert it 'on the fly' to a binarised form

This conversion will fail if paths are incorrect for #include statements (eg). Generally, any binarisation of a config requires that you set up a P: drive

You also may not wish to do this for several reasons. You can use the -x option to prevent setversion changing config.cpp's


HOWEVER
if allowed, and IF encountered, and IF successful, the original 'file' is renamed to config.cpp.txt, and a new text file replaces it. THIS, NEW text file
will be stripped of all comments and #includes (because they are unecessary at this point)



Note finally, that this is a kludge. Redundant hpp files and included cpp text files will remain in the pbo, where, normally, these too would be removed during the rapification process.