Tuesday 26 October 2010

Issues with .inc files with custom ASP scripts

Another strange one...if you modify an ASP page (eg logon.asp) I found that there can be problems with that script accessing inc files, as the links in the script seem to assume that the inc folder is in the same folder as the script - which of course it is until you make your own version.

What happens is that the script will not find inc files properly when it runs and strange things happen. What it needs is the inc files to not be in von/InternalSite/inc but be in von/InternalSite/CustomUpdate/inc

One answer is to copy all of the files that are in von/InternalSite/inc to a new folder von/InternalSite/CustomUpdate/inc. This fixes the problem nicely. However, when you update a file you need to remember to update it in both places. And UAG will not back this folder up either.

The best answer is to create a soft link (aka symlink in UNIX) in the CustomUpdate folder to the inc folder. What this does is create a link in the file system so rather than have a copy of the inc folder under CustomUpdate you actually have the real folder instead. Google symlinks to understand more about how this concept works

In windows, you use mklink to create a soft link. From the InternalSite folder run the following command

mklink /D ./CustomUpdate/inc ./inc

You should see a new folder in CustomUpdate, which should contain everything in inc. In Explorer it is shown as a shortcut (the folder has a little arrow)

No comments: