Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

remove r/o file attribute


6 replies to this topic

humba

humba
  • Members
  • 2 posts

Posted 29 April 2005 - 09:58

When adding files to a IS project the files retain their attributes they had in the file system they are taken from.

Problem: The filesystem i take them from is read only. But after installation they have to be writeable.

Ok, i may loop through all files and call SetFileInfo (...) after installation (in OnMoved).

But is there a better solution to this ?

regards


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 29 April 2005 - 14:37

Are the original files read only because of some source control system that's in place?

Edited by Taco Bell, 29 April 2005 - 15:03.

user posted image

humba

humba
  • Members
  • 2 posts

Posted 03 May 2005 - 15:05

Yes. ClearCase (v4.2) is the source of the files.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 03 May 2005 - 23:19

Okay, well I don't know of a better way to do it after the fact. Sorry man.
user posted image

samsquared

samsquared
  • Full Members
  • 18 posts

Posted 20 May 2005 - 20:40

How about running the DOS attrib command using LaunchAppAndWait and cmd.exe (or use the one from this site that hides the DOS box)? For example,

attrib -R C:\foldername\*.* /s

to remove the read-only attribute from all files in C:\foldername and its subfolders. Or, depending on how you do your builds you could issue the command on the files before you build.

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 01 June 2005 - 20:31

I had the same challenge. We use StarTeam as the controlling library system in development. The Read-Only attribute is the method that StarTeam uses to allow only one developer at a time to change files. On the PC that builds our InstallShield project, I wrote a batch file that xcopies the projects files to my designated IS file groups. I do not have IS pointed to the StarTeam folders where the original files reside, I point IS to the folders created by the batch file. The xcopy command strips the read only attribute from the files at this time....The InstallShield project is then compiled by this same batch file using IS command line options. If you need a file or files to have a read only attribute, you set it in this batch file.

The batch file also allowd me to seperate files into File Groups that were important for the installation, not the folder srtucture needed in development. For instance, all the *.exe, *.dll, and *.bpl files are in one folder in StarTeam. The batch file allows me to seperate them into three file groups.

This method allows me to control and organize the files in such a way that I do not need to add special code in the install script to slow up or goof up the install process.

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 02 June 2005 - 08:24

a third option is to loop through the installation directory after file copy, use GetFileInfo to get the read-only flag and use SetFileInfo to set it to not read-only ...
CODE
nReturn = FindAllFiles( TARGETDIR, "*.*", szResult, RESET );
while( nReturn = 0 )
 GetFileInfo( szResult, FILE_ATTRIBUTE, nvResult, svResult );
 if( nvResult & FILE_ATTR_READONLY ) then
  SetFileInfo( szResult, FILE_ATTRIBUTE, FILE_ATTR_NORMAL, "" );
 endif;
 nReturn = FindAllFiles( TARGETDIR, "*.*", szResult, CONTINUE );
endwhile;

Gruß / regards
Thomas