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

View readme.txt


1 reply to this topic

jive02

jive02
  • Members
  • 40 posts

Posted 07 March 2002 - 16:29

Hi, I have got two questions..

1. Do I need to create a custom dialog to get a checkbox
on the last dialog(sdFinish?) asking if the user want to view
the readme file?

2. When I want to open a textfile (as above) do I need to
include Notepad in the installation and spawn it with the
textfile as an argument or could I in some way get the same
effect as if the user would doubleclick a textfile, i.e. open
the file with the default text-viewer?
- jonas

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 07 March 2002 - 16:45

1.  The code would go something like this:

// LAUNCH README OPTION
szTitle = "View Readme Option";
szMsg = "Please check the application directory's Readme.txt file for important installation information.";
bvOpt1 = TRUE;
SetDialogTitle(DLG_ASK_OPTIONS, szTitle);
nResult = AskOptions(NONEXCLUSIVE, szMsg, "&View the Readme", bvOpt1);
if (nResult = BACK) goto <PREVIOUS_DIALOG>;
 
if (bvOpt1) then
    szText = WINDIR ^ "notepad.exe \"" + TARGETDIR ^ "\\readme.txt\"";
    nResult = LaunchAppAndWait(WINDIR ^ "notepad.exe", TARGETDIR ^ "\\readme.txt", WAIT);
    if ( nResult < 0 ) then
         szMsg = "Could not launch Notepad.  Please open the Readme.txt manually.";
         MessageBox(szMsg, WARNING);
    endif;
endif;

2.  No, you don't need to include Notepad.  It's safe to assume it's available under the Windows directory.  However, if you want, you can make it fancier and lookup the associated text file program and use that instead.  Either way, it's the same idea in the end.
user posted image