PDA

View Full Version : Conditional File Install


BrianMcD
08-31-2006, 11:28 AM
Question: Is there a variable I can access which tells me which file is about to be patched?

Reason:

I have a VP project with about a hundred files in a version.

When a patch is being installed, only some of these files should be installed.

To implement this, I've added a function to the "Script Condition" on each file.
http://i81.photobucket.com/albums/j201/tacoflies/conditional.jpg

This function looks more or less like the following:


function IncludeFileInInstall(sFileName)

if (bServerInstallMode == true) then
if (sFileName in arrayServerFiles) then
return true;
end
end

if (bClientInstallMode == true) then
if (sFileName in arrayClientFiles) then
return true;
end
end

return false;
end


At the moment, I need to pass in the filename as parameter in the Conditions tab of the file Properties dialog. This becomes a maintenance nightmare when you have to implement it for every file and every version in the project. I'd much rather just say:


function IncludeFileInInstall() --Parameter has been removed

if (bServerInstallMode == true) then
if (%CurrentFile% in arrayServerFiles) then --using current file variable
return true;
end
end

if (bClientInstallMode == true) then
if (%CurrentFile% in arrayClientFiles) then --using current file variable
return true;
end
end

return false;
end


I nearly solved this problem, by setting a global sCurrentFileName variable for the filename using the e_CurrentItemText in the OnProgress event of the Progress screen, but unfortunately (and understandably) this event is fired after the condition script is evaluated.

Any suggestions?

Adam
09-06-2006, 10:47 AM
Brian,

I have added this to our internal suggestions. REF: 13674

Adam Kapilik