Print Button on the License Agreement Dialog
Updated: 21 May 2010 | 3 comments
I need to print the License Agreement embedded in the License Agerement Dialog. Does Wise for Windows Installer have a way to do this?
I know InstallShield includes a Print Button on the License Dialog. Does Wise have the same ability?
Mita
discussion Filed Under:
Comments
There is no native
There is no native functionality in Wise to print the licence dialog. However, there is nothing to stop you adding in a dialog offering to print the licence agreement once accepted (for example). Alternatively, you could use a custom action to open your licence agreement in Notepad or Wordpad, which then allows the user to print from the menu option if required, and also gives you the option of having a longer agreement if your legal department cannot get their terms into the text limit of the licence dialog (32K chars IIRC)
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Another idea
Just assign a CA to a button in which you call ShellExecute. That works fine
for a text-file and so on.
The API Way
If you are in a Dialog, you can create a button and associate it with a Named Event.
The Named Event will be coded in the Dialog Script Editor.
Since the Dialog Script Editor is seriously limited on what you can do, your best option is to write using API calls (using DLLs).
Here is a sample script that has worked for me - paste the code between the lines into a script:
---------------------------------------------------------------------------
item: If/While Statement
Variable=DLG_EVENT_TYPE
Value=PRINT
end
item: Set Variable
Variable=LWT_DOC_NAME
Value=Currently Installed LPM Applications
end
item: Set Variable
Variable=LWT_OUTPUT_TEXT
Value=%LWI_INSTALLED_APPS_MSG%
end
item: Remark
end
item: Remark
Text=Get default printer name
end
item: Set Variable
Variable=LWT_PRINTER_NAME
Value=
end
item: Set Variable
Variable=LWT_PRINTER_NAME_LENGTH
Value=50
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=GetDefaultPrinterA
Argument List=40LWT_PRINTER_NAME
Argument List=70LWT_PRINTER_NAME_LENGTH
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=Open printer
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=OpenPrinterA
Argument List=40LWT_PRINTER_NAME
Argument List=80LWT_PRINTER_HANDLE
Argument List=010
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=Start printer
end
item: Set Variable
Variable=LWT_DOC_FILE
end
item: Set Variable
Variable=LWT_DOC_DATATYPE
Value=RAW
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=StartDocPrinterA
Argument List=30LWT_PRINTER_HANDLE
Argument List=011
Argument List=t0LWT_DOC_NAME
Argument List=´0LWT_DOC_FILE
Argument List=´0LWT_DOC_DATATYPE
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=Start page printer
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=StartPagePrinter
Argument List=30LWT_PRINTER_HANDLE
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=Write printer
end
item: Set Variable
Variable=LWT_OUTPUT_TEXT_LENGTH
Value=Len(LWT_OUTPUT_TEXT)
Flags=00100000
end
item: Set Variable
Variable=LWT_WRITTEN
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=WritePrinter
Argument List=30LWT_PRINTER_HANDLE
Argument List=40LWT_OUTPUT_TEXT
Argument List=20LWT_OUTPUT_TEXT_LENGTH
Argument List=70LWT_WRITTEN
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=End page printer
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=EndPagePrinter
Argument List=30LWT_PRINTER_HANDLE
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=End printer
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=EndDocPrinter
Argument List=30LWT_PRINTER_HANDLE
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: Remark
end
item: Remark
Text=Close printer
end
item: Call DLL Function
Pathname=%SYS32%\WinSpool.drv
Function Name=ClosePrinter
Argument List=30LWT_PRINTER_HANDLE
Return Variable=2LWT_DLL_RETURN
Flags=01100000
end
item: Call DLL Function
Pathname=%sys32%\Kernel32.dll
Function Name=GetLastError
Return Variable=3LWT_LAST_ERROR
Flags=00100000
end
item: End Block
end
---------------------------------------------------------------------------
Would you like to reply?
Login or Register to post your comment.