View Full Version : Restore read-only attribute for .rc or .vbp files after set version option
AlexB
12-16-2003, 05:05 AM
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?
kinook
12-16-2003, 04:05 PM
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>
AlexB
12-17-2003, 03:20 AM
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.
pjaquiery
12-17-2003, 02:41 PM
This sounds like a user configuration option in an up comming version.
Even nicer would be a check box in the action's dialog
AlexB
01-04-2004, 07:43 AM
So, can you add this CR for the next VBP release?
Thnx.
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.