Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a production website that, once built in TFS is re-deployed and updated using xcopy. The entire site (excluding the root directory) it deleted then the new site copied in. This works well.

We use a 3rd party charting package that creates images at runtime and then renders a link to them. In order to do this it needs write permissions to a browsable folder.

Unfortunately, every time we update the website the write permissions of IIS_USRS is lost. Is there any way to retain this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
199 views
Welcome To Ask or Share your Answers For Others

1 Answer

I guess it depends on what operating system the server is running, and whether you are building on the same server as you're deploying to, or a remote one.

The simplest thing to do is to put your xcopy command into a batch file, and include something like the following after the xcopy:

cacls c:[PathToWebsite][ChartImagesFolder] /E /G [AccountSiteRunsUnder]:C

Or a more up to date option (I've not used this, so my parameters may be off):

icacls c:[PathToWebsite][ChartImagesFolder] /grant [AccountSiteRunsUnder]:M

Basically, either of those should give the user account that the site is running under modify (change) rights in the folder specified. This should be in addition to any existing rights on the folder, there are modifiers or switches to replace the existing rights.

If you are deploying to a remote server, you'll need some mechanism to run commands on there, we've found that PSExec works a treat (part of the PS tools from SysInternals).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...