Search code examples
delphidelphi-2010

Project links in RAD Studio Welcome page do not work


As you know, welcome page in RAD Studio shows a list of recent projects, and you can open each project by clicking on its name.

My problem is that if the project is located somewhere My Documents folder, then the link in welcome page does not work! It works fine for projects which are located outside My Documents, but no links to anything inside My Documents work.

It's been a while I am having this problem both in RAD Studio 2009 and RAD Studio 2010 on Windows Vista and Windows 7 (64-bit).

I tried running the IDE as administrator to see if it works, but it didn't. I think it must be something related to IE security settings.

Any idea?

Thanks

EDIT:

I noticed that the problem is caused for paths with single-quote (') character in them. So if I have "C:\John's folder\Project.dproj", it won't work; but if I have "C:\John folder\Project.dproj", it works.

Now the question is, how can I make it work with paths containing single-quote character? I tried changing openFileLink() in projectLoader.js to this:

function openFileLink(fileName)
{
    try {
        external.Application.OpenFile(filename.replaceAll("'","\\'"));
    } catch(e) {
        debugAlert("openFileLink: " + e.message);
    }
}

but doing that makes openFileLink() to not work at all, even for paths without single-quote character.


Solution

  • It does work for me as expected with projects in the "My Documents" folder.

    The open command is called in an exception block and when an exception occurs then clicking does just nothing. My suggestion is that you patch $(BDS)\Welcomepage\js\projectLoader.js for testing to show the exception.

    Steps:

    • open projectLoader.js
    • look for the openFileLink function
    • look in it for debugAlert and change it to alert
    • save projectLoader.js
    • start RAD Studio 2010
    • click on a "My Documents" link on the "Recent Open Projects" page and see the alert message dialog


    $(BDS) is your RAD Studio 2010 path

    EDIT
    I can repeat the single quote issue and to fix this you could patch $(BDS)\Welcomepage\xsl\rssProjects.xsl. Look in it for replaceBackslash and replace it with

            function replaceBackslash(path) {
                var fixedFileName;
                fixedFileName = path.replace(/\\/gi, '\\\\');
                fixedFileName = fixedFileName.replace("'", "\\'");
                return fixedFileName;
            }
    

    Please create a QC report for the issue.