B4J Question B4j packager - license file (EULA)

Nokia

Active Member
Licensed User
Longtime User
I guess I am not understanding on where to put the license.txt file so that is shows during the install. Can anybody shed some light on this?

Also does anybody know if I can add file association during the install with an icon?
 

Nokia

Active Member
Licensed User
Longtime User
Try to add this line (before shl is initialized):
B4X:
args.AddAll(Array("-BlicenseFile=", "path to file"))

It is not possible to add file association.


I get this error when I try your way..
StdErr: Error: Unknown argument: C:\Data\license.txt

but I get this error when I try my original way..

B4X:
args.Add("-BlicenseFile=" & txtLicensePath.text)

Program started.
true
App identifier: b4j.example.main
Success: true
StdOut: Using base JDK at: C:\Program Files\Java\jdk1.8.0_66\jre
Using base JDK at: C:\Program Files\Java\jdk1.8.0_66\jre
Bundler EXE Installer skipped because of a configuration problem: Specified license file is missing.
Advice to fix: Make sure that "C:\Data\license.txt" references a file in the app resources, and that it is relative file reference.
StdErr:
ExitCode: 0


this is the code I have
B4X:
args.Initialize
     args.AddAll(Array ("-deploy", "-srcFiles", txtJar.Text, "-native", packageExtension, _
       "-BsystemWide=true", "-title", txtTitle.Text, "-name", txtName.Text, "-outdir", workingFolder, _
       "-outfile", "1.exe", "-BappVersion=" & txtVersion.Text, "-appclass", appClass, _
       "-Bidentifier=" & appClass))
     If windows Then
       args.Add("-Bruntime=" & GetSystemProperty("java.home", ""))
       args.Add("-BmenuHint=true")
       args.Add("-Bwin.menuGroup=" & txtName.Text)
       args.Add("-BshortcutHint=" & chckDeskShortcut.Checked)
       args.Add("-Bcopyright=" & txtCopyRight.text)
       args.Add("-BlicenseFile=" & txtLicensePath.text)
       args.Add("-Bvendor=" & txtVender.text)
     End If
     If txtIcon.Text <> "" Then args.Add($"-Bicon=${txtIcon.Text}"$)
     filename = File.Combine(workingFolder, "bundles/" & txtName.Text & "-" & txtVersion.Text & "." & packageExtension)
     File.Delete(filename, "")
     shl.InitializeDoNotHandleQuotes("shl", txtPackager.Text, args)
 
Upvote 0

Nokia

Active Member
Licensed User
Longtime User
Steps to add a license file:

1. Add the license file to the srcFiles arguments (line 132 here):
B4X:
"-srcFiles", txtJar.Text
To:
B4X:
"-srcFiles", "c:\temp\License.lic;" & txtJar.Text

2. Add this line:
B4X:
args.Add("-BlicenseFile=License.lic")

thanks @Eran Jesusa

it worked.. this is the updated code..

B4X:
args.AddAll(Array ("-deploy", "-srcFiles", txtLicensePath.text & ";" & txtJar.Text, "-native", packageExtension, _
       "-BsystemWide=true", "-title", txtTitle.Text, "-name", txtName.Text, "-outdir", workingFolder, _
       "-outfile", "1.exe", "-BappVersion=" & txtVersion.Text, "-appclass", appClass, _
       "-Bidentifier=" & appClass))
     If windows Then
       args.Add("-Bruntime=" & GetSystemProperty("java.home", ""))
       args.Add("-BmenuHint=true")
       args.Add("-Bwin.menuGroup=" & txtName.Text)
       args.Add("-BshortcutHint=" & chckDeskShortcut.Checked)
       args.Add("-Bcopyright=" & txtCopyRight.text)
       args.Add("-BlicenseFile=" & File.GetName(txtLicensePath.text))
       args.Add("-Bvendor=" & txtVender.text)
     End If

would I add the icon to the -srcFiles the same way to show my icon and not the java icon?
 
Upvote 0
Top