B4J Tutorial UI apps packaging - self contained installers

Discussion in 'B4J Tutorials' started by Erel, Aug 2, 2015.

Thread Status:
Not open for further replies.
  1. olivere

    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 ?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I guess that you haven't installed InnoSetup, right?
    As written in the first post you must install it before you can use this tool.

    javapacakger native app depends on InnoSetup to build the installer.
     
  3. olivere

    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 ?
     
  4. Douglas Farias

    Douglas Farias Expert Licensed User

    @Erel
    1 - Question About Folder
    you sample code
    Code:
    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.
    Code:
    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?
     
  5. olivere

    olivere Member Licensed User

    I found the solution (maybe also of interest for others): add installation path of InnoSetup to PATH variable in your windows environment variables.
     
    Mark Baars likes this.
  6. olivere

    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
     

    Attached Files:

  7. Erel

    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.
     
  8. tdocs2

    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: Aug 11, 2015
    Douglas Farias likes this.
  9. Roycefer

    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.
     
    tdocs2 likes this.
  10. Douglas Farias

    Douglas Farias Expert Licensed User

    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
     
  11. tdocs2

    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
     
    Douglas Farias likes this.
  12. Douglas Farias

    Douglas Farias Expert Licensed User

    Yes, i dont have the error more, only first time but no problem :)
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    Try this for the menu name. Add the following line after the args.AddAll line:
    Code:
    args.AddAll(Array("-BmenuHint=true""-Bwin.menuGroup=Test"))
     
    Last edited: Jan 5, 2016
  14. micro

    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
     
  15. tdocs2

    tdocs2 Well-Known Member Licensed User

    Thank you, Erel.

    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"

    Code:
    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
     
  16. Roycefer

    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 likes this.
  17. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
    jmon and tdocs2 like this.
  18. tdocs2

    tdocs2 Well-Known Member Licensed User

    I am glad you have a sense of humor... :):):)
     
  19. tdocs2

    tdocs2 Well-Known Member Licensed User

    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
     
  20. micro

    micro Well-Known Member Licensed User

    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?
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice