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

determining if a folder is read only


4 replies to this topic

smcburney

smcburney
  • Members
  • 3 posts

Posted 20 August 2003 - 21:42

I need a custom action that can determine if a folder is read only. I can easily get the "read only" attribute from the folder, but the real problem is that I need to know if the user can write files to a network share or not.

If a folder is on a network share, it may not have its read only bit set, but because of security settings, the folder may be read only.

Any suggestions as to how to go about finding out this?


Scott McBurney
Software Developer
Interface Software, Inc.
Email: smcburney@interfacesoftware.com

user posted image

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 21 August 2003 - 13:59

Take a look at MsiSetTargetPath. Note: (not clearly stated in the docs) You can only call MsiSetTargetPath after CostFinalize.

BASnow

BASnow
  • Members
  • 9 posts

Posted 21 August 2003 - 15:31

Take a look here. You should be able to find a script that does what you need. This site is probably the best script resource that I have found.

http://www.microsoft...der/default.asp

Another workaround is to write a script that tries to open a temporay file in the network folder in question. If the operation fails then you know that the user does not have write access to that folder.

smcburney

smcburney
  • Members
  • 3 posts

Posted 22 August 2003 - 16:28

ok, I'm getting somewhere. I've got a custom action that tries to determine if the path is read only or not, and sets a property to 1 if its read only, 0 if its not.

I also have a non-visible feature in the install, with a condition that changes its install level to 1 if the read only property is 0 (meaning I can write out the files).

However, upon installation, the feature install level is never changed.

So I guess the next question is where in the execution sequence should this custom action go so that the condition on the feature will see it and enable the feature?


Scott McBurney
Software Developer
Interface Software, Inc.
Email: smcburney@interfacesoftware.com

user posted image

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 August 2003 - 14:22

It must be insertede before CostFinalize in both UI and Execute sequence (because feature conditions are evaluated during CostFinalize)