Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Shortcut for PDF File


14 replies to this topic

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 09 December 2004 - 16:09

I am creating an installation which consists of creating a folder in StartMenu->Programs. One of the shortcuts is for the PRODUCT_KEY. Another shortcut is for a (.txt) file. I create a shortcut for NOTEPAD.EXE with the txt file as an argument. That works fine.

The problem I am having is when I try to create a shortcut for the pdf file. Using the registry functions, I get the path to acrord32.exe. When I try to invoke the Adobe Acrobat reader with the pdf file as an argument, it gives me an error message. Does anybody know the correct way to invoke the Acrobat Reader from the command line with a pdf file? Thanks.

Raj

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 10 December 2004 - 14:23

how do you start acrord32?
what error do you get?

please post that piece of code, so we can help you.
it should be no problem to start the acrord32 (as found in registry with complete path) with the pdf-to-show (with complete path) and maybe some params ...
Gruß / regards
Thomas

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 10 December 2004 - 18:30

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if ( RegDBKeyExist (@APP_PATHS ^ @ACROBAT_PATH) < 0 ) then
MessageBox("Failed to create Surveillance Help entry", WARNING);
else
if (RegDBGetKeyValueEx(@APP_PATHS ^ @ACROBAT_PATH, "Path", nType, szDirValue, nvSize) < 0) then
MessageBox("Failed to create Surveillance Help entry", WARNING);
else
szAcrobatpathentry = szDirValue ^ @ACROBAT_PATH + " " + "FtpBasedSurveillanceSystem.pdf";
nResult = AddFolderIcon(ProgramFolder, // location
"Surveillance Help", // name
szAcrobatpathentry, // executable
svDir, // working dir.
"", // icon path
0, // icon no.
"", // shortcut key
REPLACE); // param. flag
if (nResult != 0) then
MessageBox("Failed to create Surveillance Help entry", WARNING);
endif;
endif;
endif;





I think there should be a better way to do this. I have been instructed to place the .pdf file in the menu. When the user selects the .pdf file, the Acrobat reader should come up and load the file automatically. My users said I should not try to hardcode this in.

Raj

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 10 December 2004 - 19:22

I figured out the problem. I wasn't using LongPathToQuote. Anyhow, I want to add a pdf file to the menu folder, where if I click on it, the Adobe Acrobat reader pops up with the target file. Is this possible? If I use AddFolderIcon, I can only use an executable in for the commandline entry. Any help would be appreciated.

Raj

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 11 December 2004 - 06:56

The function AddFolderIcon is NOT restricted to executables. You can do make one for any such extension and it will simply make use of the associated program (if any).

For example, I make a variety of shortcuts in my setups such as PDF, HLP, HTML, and TXT.
user posted image

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 11 December 2004 - 19:56

I believe you're mistaken. I was able to install a menu shortcut for a pdf file on Win2000 computer with Adobe Acrobat. For some reason, it didn't associate with the Adobe Acrobat Reader. When I click directly on the pdf file in the Windows Explorer, that will work fine, with Acrobat application coming up and loading the pdf file correctly.

On Windows XP systems, I was unable to create a menu shortcut for the pdf. AddFolderIcon is unsuccessful in creating the menu shortcut.

Can you please show me source code which will implement this? I would greatly appreciate. I have never had problems using AddFolderIcon in creating shortcuts for executables, only with non-exe files.

Raj

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 12 December 2004 - 04:01

Well I can assure you I'm not mistaken. wink.gif

Therefore, based on my basic FAQ, are you using IS Pro 6.31 and do you have XP selected as a supported platform? 'cause otherwise it's not a properly supported OS.

Edited by Taco Bell, 12 December 2004 - 04:02.

user posted image

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 13 December 2004 - 15:43

I am using InstallShield Professional 6.12.

Raj

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 13 December 2004 - 15:46

Can you show me the source code for adding the shortcut for the pdf file?

Raj

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 14 December 2004 - 02:59

I doubt showing you my source will help since the same shortcuts work on Windows 2000. Again, what you really need is IS Pro 6.31 to properly support XP!
user posted image

rajkulkarni

rajkulkarni
  • Full Members
  • 44 posts

Posted 14 December 2004 - 15:08

The shortcut menu is added in Windows 2000, but selecting it doesn't bring up the Acrobat Reader. I want to see how you call AddFolderIcon. Thanks.



Perotin

Perotin
  • Full Members
  • 407 posts

Posted 14 December 2004 - 16:15

TacoBell's approach is to use
CODE
szAcrobatpathentry = svDir ^ "FtpBasedSurveillanceSystem.pdf"
in your setup, but don't forget the path to the pdf file !!
Windows should get the executable which is linked to the file extension and start it ...

Edited by Perotin, 14 December 2004 - 16:16.

Gruß / regards
Thomas

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 14 December 2004 - 19:27

Oh, that's right. I was mistaken in how I remembered it functioning under Windows 2000.

Perotin has the right idea though and that is how I go about it.
user posted image

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 15 December 2004 - 09:16

QUOTE
Well I can assure you I'm not mistaken.  wink.gif

So you have been mistaken, but you're not ... cool.gif

difficulties for not-native-speakers ...

Edited by Perotin, 15 December 2004 - 09:17.

Gruß / regards
Thomas

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 15 December 2004 - 21:09

WellI wasn't mistaken on that point, but I'll try and be more clear for those to which English is a 2nd/3rd language. wink.gif
user posted image