B4J Tutorial UI apps packaging - self contained installers

Status
Not open for further replies.

olivere

Member
Licensed User
I forgot: you mention the need of InnoSetup on Windows PC.
Why is this needed ? If B4J Packager creates a single installer exe, there should be no need for InnoSetup ?
 

olivere

Member
Licensed User
No, there must be another reason: InnoSetup is installed (Build 5.5.6), also the Inno SetupStudio..
Doy ou have another idea ?
 

Douglas Farias

Expert
Licensed User
@Erel
1 - Question About Folder
you sample code
B4X:
Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
   If os.Contains("win") Then
    workingFolder = File.Combine(GetEnvironmentVariable("AppData", ""), "YourAppName")
    File.MakeDir(workingFolder, "")
   Else
     workingFolder = File.DirApp
   End If
its only for write comand?
for example i have this code on my app.
B4X:
File.Copy(File.DirAssets, "Update.jar", File.DirApp, "Update.jar")
i need to use your code on this case?


2 - Run Adminitrator
I have tested the installer on my another pc with windows 10, the installer works fine, later create a icon o start menu.
But when i click app open and close fast, open show for 1s and close.
To fix this i need to run as administrator, when i run a administrator works fine.

Have a way to ever run a administrator? or ever show a option to run with administrator?
if dont run with administrator my app dont work.


3 - Change Unknown Folder on start menu
un.png


how can i chance this folder name?
 

olivere

Member
Licensed User
No, there must be another reason: InnoSetup is installed (Build 5.5.6), also the Inno SetupStudio..
Doy ou have another idea ?
I found the solution (maybe also of interest for others): add installation path of InnoSetup to PATH variable in your windows environment variables.
 

olivere

Member
Licensed User
Sorry to bother you again: there seeem to be another issue.
I installed your GoogleMapsExample.exe - on my Windows7 (64) all works perfectly. Then I tried with Windows XP and Windows 8 (each "naked" as out of the box) in virtual machines: installations performs without error, but when running an error occurs: no valid 32bit application.

Is it possible, that you've created the package on a 64bit system, such the exe is 64bit too ? If yes, is there a way to choose the type, that you can package also a 32bit deployment on a 64bit system ?

Thank you and best regards
Oliver
 

Attachments

Erel

Administrator
Staff member
Licensed User
@Douglas Farias
1. http://www.b4x.com/android/forum/threads/data-folder.56874/
2. I'm not sure why you need administrator access. I tried it on Windows 10 and it didn't ask for administrator access (and worked properly).
3. See the win.menuGroup parameter: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html#BGBIJBHF

@olivere
Please try to create a new installer and use a 32 bit version of Java JDK. Set it under Tools - Configure Paths. It should point to Program Files (x86).
Such an installer will work on both 32 bit and 64 bit.
 

tdocs2

Well-Known Member
Licensed User
@Erel and @Douglas Farias

Thank you, Erel - this is really good... :):):)

I muddled my way to get it to work... @Douglas Farias - I did not need admin in Win 10.

1. It installs the app as an .exe in Program Files\yourfolder which I assume it is the Name used in the Packager.

However, one question (same as Douglass):

1. The shortcut to the app is put in folder Unknown. How is that changed? I could not follow the discussion win.menuGroup=group parameter.

win.menuGroup=group
Menu group in which to install the application when menuHint is true. This argument is ignored when menuHint is false.

Thank you.

Sandy

PS: EDIT: I was successful in running the Myapp.exe in Win 7 with no JAVA installed. I had failed to copy one DB to the Win 7 PC. Mea culpa.
 
Last edited:

Roycefer

Well-Known Member
Licensed User
Run Myapp.exe from the command line to see what errors or exceptions are reported.

Make sure Myapp.jar works outside the IDE on a computer that has Java installed.

Make sure Myapp.exe isn't trying to write to File.DirApp.
 

Douglas Farias

Expert
Licensed User
PS: I installed successfully on a Win 7 PC that does not have JAVA. Myapp.exe fails to execute even when I run directly from Program Files... Help please.
Rebooted Win 7, tried running as Admin to no avail; Check compatibility - just said Incompatible Application.
this is the problem i have reported, same error, try with run administrator. (i have tested on win 10 without java too)
later i run administrator first time dont have error anymore
 

tdocs2

Well-Known Member
Licensed User
@Roycefer @Douglas Farias

I was successful in running the Myapp.exe in Win 7 with no JAVA installed. I had failed to copy one DB to the Win 7 PC.

Thank you, Roycefer :). Your diagnostic suggestions made me put my thinking cap on.

Douglass, Do you have all the files your app needs?

Sandy
 

micro

Well-Known Member
Licensed User
Hi,
the installation package created is executed correctly, but when I click on the icon, says that the version is not compatible with the version of installed window.
Package and program code developed on win7/8 64 bit and package installed on win7 32bit.
How I can fix it?
Thanks
 

tdocs2

Well-Known Member
Licensed User
Thank you, Erel.

Try this from the menu name. Add the following line after the args.AddAll line:
B4X:
args.AddAll(Array("-BmenuHint=true", "-Bwin.menuGroup=Test"))
The menu group continues to be Unknown. This is the code - I tried it after the Addall and within the Addall in the Sub btnBuild_Action.
I did not understand what you meant "from the menu name" - I assumed "for the menu group name"

B4X:
        args.AddAll(Array ("-deploy", "-srcFiles", txtJar.Text, "-native", packageExtension, _
            "-BsystemWide=true", "-title", txtTitle.Text, "-name", txtName.Text, "-outdir", workingFolder, _
            "-outfile", "1.exe", "-BshortcutHint=true", "-BmenuHint=true", "-Bwin.menuGroup=Test", "-BappVersion=" & txtVersion.Text, "-appclass", appClass, _
            "-Bidentifier=" & appClass))
'        args.AddAll(Array("-BmenuHint=true", "-Bwin.menuGroup=Test"))
Sandy
 

Roycefer

Well-Known Member
Licensed User
Micro,
Try this:
Download and install a 32-bit JDK on your development computer. On Oracle's website, it will be named the same except for having "-x64" at the end replaced with "-i586".
Follow all the steps enumerated by Erel in the original post, except replace all the Java addresses with the equivalents in your 32-bit JDK. They will probably be under "Program Files(x86)".
This should build a 32-bit executable with an embedded 32-bit JRE.
 

Erel

Administrator
Staff member
Licensed User
I did not understand what you meant "from the menu name" - I assumed "for the menu group name"
I also do not understand what I meant :)

Please try to replace the app package name and then use this tool to build a new installer. Maybe Windows remembers the previously installed menu group.
 

tdocs2

Well-Known Member
Licensed User
Please try to replace the app package name and then use this tool to build a new installer. Maybe Windows remembers the previously installed menu group.
As usual, you are correct - it was a Windows latency issue. I changed the app package name and it worked - the appropriate menu group was created. SOLVED.

Can't give deserved double likes - :):)

Best regards.

Sandy
 

micro

Well-Known Member
Licensed User
Micro,
Try this:
Download and install a 32-bit JDK on your development computer. On Oracle's website, it will be named the same except for having "-x64" at the end replaced with "-i586".
Follow all the steps enumerated by Erel in the original post, except replace all the Java addresses with the equivalents in your 32-bit JDK. They will probably be under "Program Files(x86)".
This should build a 32-bit executable with an embedded 32-bit JRE.
Installed 32-bit JDK and when run build in a few second (too few) appears a window message "Package built successfully" but the folder is empty.
Why?
 
Status
Not open for further replies.
Top