Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Location
    England
    Posts
    9

    Shortcut Problem

    Greetings,

    Please excuse me if there is an obvious answer to this problem, I am new to Setup Factory and still learning the ropes.

    The problem is this: I have an important PDF document which must be available for the end user as a shortcut on the desktop. Now, I can't guarantee that the end-user will have a default Acrobat reader installed so, rather than include the Adobe bloat-ware package, I decided to include Foxit as a small standalone reader.

    I have utilised the sample function "ir_GetAcrobatVersion" (provided with SF7) to determine whether Acrobat reader is installed and, if not, to create a shortcut to Foxit with the PDF document's full path as a command line parameter.

    This is the code I'm using:

    Code:
    sTrainingManPath = _ProgramFilesFolder .. "\\BIT\\Training Manual.pdf";
    sFoxitReaderPath = _ProgramFilesFolder .. "\\BIT\\Foxit Reader.exe";
    PDFVerNo = ir_GetAcrobatVersion();
    if PDFVerNo ~= "0.0.0.0" then -- An Acrobat reader is installed
        Shell.CreateShortcut(_DesktopFolder, "Training Manual", sTrainingManPath, "", "", "", 0, SW_SHOWNORMAL, nil, "");
    else -- Use Foxit
        Shell.CreateShortcut(_DesktopFolder, "Training Manual", sFoxitReaderPath, sTrainingManPath, "", "", 0, SW_SHOWNORMAL, nil, "");
    end
    Unfortunately, it doesn't work properly. It creates the shortcut alright, but the command line parameter isn't in quotes, so Foxit objects. How do I create the command line parameter with quotes?

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Jun 2005
    Posts
    470
    this way it should put quotes around path to reader & path to file

    Code:
    Shell.CreateShortcut(_DesktopFolder, "Training Manual", "\"" .. sFoxitReaderPath .. "\"", "\"" .. sTrainingManPath .."\"" , "", "", 0, SW_SHOWNORMAL, nil, "");
    as quotes have to be escaped in strings, add \"

  3. #3
    Join Date
    Nov 2007
    Location
    England
    Posts
    9
    Thanks pww, that's done the trick.

Similar Threads

  1. Problem with Uninstall Shortcut
    By SteveinVegas in forum Setup Factory 7.0
    Replies: 2
    Last Post: 12-02-2006, 08:49 AM
  2. Little but annoying shortcut problem.
    By jalari in forum Setup Factory 6.0
    Replies: 2
    Last Post: 02-18-2003, 01:25 AM
  3. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM
  4. HOWTO: Uninstall a Shortcut Created with Actions
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-25-2002, 09:50 AM
  5. HOWTO: Create a Shortcut on the Desktop
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-19-2002, 02:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts