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

License Agreement Printing


12 replies to this topic

gjmetro

gjmetro
  • Members
  • 1 posts

Posted 01 August 2003 - 15:53

How do you print the License Agreement in the InstallShield Developer dialog box?

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 04 August 2003 - 07:24

Do you mean inside a project, or the text license for Install Shield Developer?

Cant you just save the text file and print it?

Eagles

Eagles
  • Members
  • 5 posts

Posted 29 August 2003 - 00:59

Is it possible to enable the user to print out the License Agreement so they have a hard copy?



luke_s

luke_s
  • Full Members
  • 532 posts

Posted 01 September 2003 - 23:02

Windows installer does not provide functionality to do this, so you will have to create a custom action that will do this, and links this to a print button.



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 30 September 2003 - 03:37

Here is some sample code that might be useful. It basically uses Wordpad to print to the default printer.

CODE
function MM_PrintEULA( hMSI )
   STRING szWordPadFolder, szEulaSelection, szEulaToOpen;
   NUMBER nBuffer, nMsg, nwParam, nlParam, nReturn, nvExitCode;
   HWND hMsiWnd, nHwnd;  
begin
 
 // the path to wordpad.exe appears to be the same on all NT based os's
 szWordPadFolder = PROGRAMFILES ^ "Windows NT\\Accessories\\Wordpad.exe";
 
 nBuffer = 256;
 // determine what EULA was selected
 MsiGetProperty ( hMSI, "EULA_REGION", szEulaSelection, nBuffer );

 if szEulaSelection = "1" then
  szEulaToOpen = "ENG_EULA_US.rtf";
  elseif szEulaSelection = "2" then  
  szEulaToOpen = "ENG_EULA_UK.rtf";
  elseif szEulaSelection = "3" then
  szEulaToOpen = "ENG_EULA_EU.rtf";
  elseif szEulaSelection = "4" then
  szEulaToOpen = "ENG_EULA_US.rtf";
  else
    szEulaToOpen = "GER_EULA_GER.rtf";  
 endif;  

// Print license agreement to default printer  
try
   _LaunchAppEx(szWordPadFolder, "/p " + SUPPORTDIR + szEulaToOpen, NOWAIT, FALSE , 500, nvExitCode);
   //LaunchApp ( szWordPadFolder , "/p " + SUPPORTDIR + szEulaToOpen );
   Delay (1);
   if nvExitCode = 0 then
    MessageBox ( @General_PrintEULA, INFORMATION);
     else
       MessageBox ( @Error_PrintEULA, INFORMATION);
   endif;
catch
   MessageBox ( @Error_PrintEULA, INFORMATION);
   Err.Clear;
endcatch;

end;

Regards
-Stein Åsmul

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 07 November 2003 - 02:53

Note that the code above only works for Windows NT based, English OS's. On localized OS versions and Win9x you would need to add a feature to locate the wordpad.exe file yourself.
Regards
-Stein Åsmul

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 November 2003 - 12:12

You should be able to call ShellExecute on the .rtf file in a custom action to print it. This would avoid any dependency on localization etc.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 07 November 2003 - 20:05

How would you know what command line switch to use to print if you don't know what application that handles RTF? Maybe there is a standard windows API call that can be used to print (bypassing the default application).
Regards
-Stein Åsmul

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 November 2003 - 14:19

HINSTANCE ShellExecute( HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);

Pass in "print" in the lpOperation parameter. ShellExecute works with verbs, not command line switches. It performs the same task as right clicking the file and selecting "print".

dcleous

dcleous
  • Members
  • 38 posts

Posted 19 February 2004 - 16:37

Stefan:
I was trying to do something similar to what you explained.
But at the point of "License Agreement" screen I wouldn;t have the files installed.I'm not using installshield on this project(to use SUPPORTDIR).
Can you please explain any other procedure...to access the file in my MSI?
Or Do I have to extract the filestream out first?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 February 2004 - 18:46

Yes you have to stream the file from the msi file to the temp dir (for instance), or have a uncompressed copy in your media.

neil.wills

neil.wills
  • Members
  • 1 posts

Posted 04 May 2004 - 08:25

I have a similiar issue to the one discussed, an someone explain to me how you can use Orca to edit and add a button on the License dialog, and then add a custom action to that button in the msi.

I believe the next step is to add acustom action which should be called from the print button can you show me how to add this.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 May 2004 - 15:54

Did you read the MSI documentation? The related tables are all described there.