Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a disclaimer to PDW 2

Status
Not open for further replies.

MattBegg

Programmer
Jan 19, 2001
42
CA
Here is a way to add an "I accept" / "I do not accept" disclaimer or license screen to Package and deployment wizard

Firstly package your project with package and deployment wizard

Next make you disclaimer or license file as a text file, call it say disclaimer.txt and add it to the support directory that PDW creates

Edit setup.lst in notepad to add the disclaimer text file to the bootstrap

File7=@msvbvm60.dll,$(WinSysPathSysFile),$(DLLSelfRegister),,5/27/00 12:00:00 AM,1388544,6.0.88.77
File8=@disclaimer.txt,$(WinSysPath),,,6/12/01 1:26:00 PM,
I am not sure that the disclaimer needs the date stamp, but I have included it :)

Next edit <appname>.ddf in notepad to ensure that the batch file includes the text file in the cab file

.Set Cabinet=on
.Set Compress=on
&quot;disclaimer.txt&quot;

Next step go to c:\program files\microsoft visual studio\vb98\wizards\pdwizard\ and make a back up of the setup1 directory.

Open up the setup1 directory and open up the setup1.vbp project file.

In the code for the frmsetup1 find the line which reads ShowWelcomeForm
Comment it out and enter ShowDisclaimerForm above it.

Next enter a new procedure for the ShowDisclaimerForm at the end of the code for frmsetup1

Private Sub ShowDisclaimer()
If Not gfNoUserInput Then
frmDisclaimer.Show vbModal
End If
End Sub

Add a new form to the project and call it frmDisclaimer add to it a text box (text1), a frame with 2 option buttons (option1(0) and option1(1)) and 2 command buttons cmdNext (caption = &quot;Next>>&quot;) and cmdClose.

Add the following code to the form

Private Sub cmdNext_Click()
Unload Me
frmSetup1.ShowWelcomeForm
End Sub

Private Sub CmdClose_Click()
ExitSetup Me, gintRET_EXIT
End Sub

Private Sub Form_Load()
Option1(1).Value = True
cmdNext.Enabled = False
Text1.Text = gettext(gstrWinSysDir & &quot;disclaimer.txt&quot;)
End Sub


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
HandleFormQueryUnload UnloadMode, Cancel, Me
End Sub

Private Sub Option1_Click(Index As Integer)
If Option1(0).Value = True Then
cmdNext.Enabled = True
Else
cmdNext.Enabled = False
End If
End Sub

Private Function gettext(FileName As String) As String

FF = FreeFile
Open FileName For Binary As #FF
ReadText$ = String$(LOF(FF), 32)
Get #FF, 1, ReadText$
Close #FF
gettext = ReadText$


End Function


Save the project and write the exe saving it to the directory you have been working in so that it does not overwrite the default setup1.exe

Copy the newly compiled setup1.exe to your support directory for your application.

Run the batch file

What happens is that in the boot strap the text file is copied to the windows\system directory and then read in by the form.

You now have a license / disclaimer form

Hope this may be of some use


Regards

Matt

matt@begg-uk.co.uk
 
Early in your disclaimer steps you say to comment out ShowWelcomeForm.

About a dozen lines later you say frmSetup1.showwelcomeform

This does not appear to work.

How to solve the riddle?

thanx.

Kim
 
MattBegg,

This looks very useful.

When you have sorted out kimpeterson's query, it may be worth putting this up as a FAQ
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
This is already in the FAQs, as I have used it.

Two things:

1: It's <projectname>.ddf, not <appname>.ddf that you need to edit. It app name may be the same name as the project, but then again it may not. It should be the only .ddf file in the directory, anyway.

2: I found that trying to use the file name &quot;disclaimer.txt&quot; would not work. It would shorten the file name to &quot;disclaim.txt&quot; and create a empty txt file with this name in the windows system directory. If you notice, all of the file names in the bootstrap list are 8 characters long. I think it has a problem with long file names and cuts them off.

Robert
( On the road in Miami... )
 
Hi,
I tried your program but,
when executing the batch file .
i am getting a message like;
'please insert the file ' and it throws me out of the
program

regards
John Philip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top