|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
Restore read-only attribute for .rc or .vbp files after set version option
I use "Set the project version..." option in the Version tab for the VisualC and VisualBasic steps.
This feature deletes read-only flag for .rc (VC resource) or .vbp (VisualBasic project) file and set the version. The problem is that VisualBuild does not restore the read-only flag for these files. Is there any workaround for this bug? Last edited by AlexB; 12-16-2003 at 05:09 AM. |
#2
|
|||
|
|||
That behavior is by design. If the action modifies a file, it leaves it writeable so that it's clear that it has been modified. Typically, you would want to commit the version change to a source control system as part of the automated build, which would also usually set the file back to read-only when checked in / committed.
You can set the file(s) back to read-only manually if necessary via a Run Program step like (this can be copied/pasted into VBP): <step action='Run Program' type='0'> <command>%DOSCMD% attrib +r *.rc /s</command> <description>Recursively sets all .rc files to read-only in the current .bld project dir</description> <indent type='3'>1</indent> <name>reset read-only</name> <outputfrom type='3'>1</outputfrom> <startin>%PROJDIR%</startin> </step> |
#3
|
|||
|
|||
I can't agree with it.
If I want to commit the version change I have to check the file out before (and delete read-only attribute) and check it in after compilation. And I can't reset read-only attribute because I don't know if this file was writeable or no before (or I need to save the attribute before). In my case I don't want to commit version change to source control. In all cases it is dangerous to modify readonly attribute outside of source control system. Now I get situation when there is writeable checked in file. IMHO VBP must restore readonly (in other words - doesn't change readonly attribute). Thanks. |
#4
|
|||
|
|||
This sounds like a user configuration option in an up comming version.
Even nicer would be a check box in the action's dialog |
#5
|
|||
|
|||
So, can you add this CR for the next VBP release?
Thnx. |
|
|