views:

216

answers:

4

Hi,

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.

+1  A: 

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.

Uwe Schuster
Thanks, but placing Alert anywhere inside openFileLink() doesn't cause welcome page to show the alert. Also now I know the problem is caused by single-quote character in project path . Please refer to my edit for original question. Regards.
vcldeveloper
I see the problem - open openFileLink isn't called for filenames with the single quote. BTW, "Alert" wouldn't work anyway, because it needs to start with a lowercase "a" as I wrote in the steps.
Uwe Schuster
@Uwe, Thank you for the workaround and QC report.
vcldeveloper
A: 

Works as advertised for me...
Just to confirm (D2010, Win7x64):

  • created a new VCL Form application
  • saved it under Documents (not My Documents anymore in win7)
  • closed all
  • it was there 1st on the Welcome Page:
    Ø PTestWelcomePage.dproj (Make me a Favorite)
    Location: C:\Users\MeUser\Documents\PTestWelcomePage.dproj
    Personality: Delphi
  • clicked it
  • It opened
François
A: 

I have had problems with the Welcome Page like this before when the complete path of the project exceeded a specific length. IIRC the path was scrambled with some ellipses in between (like for display) resulting in an error during opening.

QC48788

Uwe Raabe
Thanks, but it seems my problem is caused by single-quote character in the path.
vcldeveloper
A: 

Hi,

Go check in your registry database the key HKEY_CURRENT_USER\Software\CodeGear\BDS\7.0\Closed Projects (7.0 stands for D2010, change it to 6.0 for D2009) to see what paths Delphi stored.

If you do not create that many new projects, you can fix the projects' path manually. Otherwise, you'll have to figure out why a broken path is stored.

I have already witnessed strange interactions between file paths and file accessed through Windows 7 "Libraries" (such as the "Documents" library) : in some cases, programs would not detect the same path for a file selected in a dialog if I selected the file by manually browsing through "C:\Users\MyName\Documents\file" rather than click on the "Documents" library on the left, and selecting the same file.

LeGEC