ApplicationBuilder.jl icon indicating copy to clipboard operation
ApplicationBuilder.jl copied to clipboard

A lot of problems

Open gabrielfreire opened this issue 6 years ago • 1 comments

Hello @NHDaly , thank you very much for this GREAT package, i am in love with Julialang

having said that 👍 .

I had a couple of problems in Windows 10 using Julia 1.1.0

there is nothing special about my Windows installation or Julia installation or environment in general.

  • ERROR: Unable to find compatible target in system image. < this error was due to the following line, more specifically, the default value for cpu_target
function build_app_bundle(juliaprog_main;
        appname = splitext(basename(juliaprog_main))[1], builddir = "builddir",
        binary_name = splitext(basename(juliaprog_main))[1],
        resources = String[], libraries = String[], verbose = false,
        bundle_identifier = nothing, app_version = "0.1", icns_file = nothing,
        certificate = nothing, entitlements_file = nothing,
        snoopfile = nothing, autosnoop = false, cpu_target="x86-64",
        create_installer = false, commandline_app = false,
    )

i was not able to solve this by changing to cpu_target = string(Base.Sys.ARCH) but i was able to solve this by setting it to cpu_target = nothing. How it worked and why i had this problem is a mistery to me

  • I had some problems trying to create an installer as well i don't have the exact error message here now to copy and paste to you but i'll try to reproduce as faithfully as i can UndefVarError: win_installer is not defined < something like that

I managed to sort this out by adding the following lines to the top of ApplicationBuilder.jl just below the Sys.isapple() check

@static if Sys.isapple()
    include("sign_mac_app.jl")
    include("mac_commandline_app.jl")
end

""" THIS """
@static if Sys.iswindows() 
    include("win-installer.jl") 
end

After being able to access the win_installer method, i had another error

UndefVarError: JULIA_HOME is not defined

I managed to fix that by changing these lines

function win_installer(builddir; name = "nothing",
				license = "$JULIA_HOME/../License.md")

to these lines

JULIA_HOME = get(ENV, "JULIA_HOME", "")
LICENSE_PATH = joinpath(abspath(JULIA_HOME, ".."), "License.md")

function win_installer(builddir; name = "nothing",
				license = LICENSE_PATH)

BTW, in Windows at least, "$JULIA_HOME/../License.md" this doesn't seem to resolve to a valid path so i also had to change the nsis_file path from

# this resolves to "$builddir/../$name.nsi" which doesn't exist anywhere
nsis_file = joinpath(builddir, "..", "$name.nsi") 

to

nsis_file = joinpath(abspath(builddir, ".."), "$name.nsi")

I'm not sure why you build your paths this way joinpath(builddir, "..", "$name.nsi") or "$JULIA_HOME/../License.md" because i'm new to Julia and arrived on Version 1.1.0 already, maybe that's the way it used to work before, i don't know.

This doesn't resolve to parent folder

joinpath(builddir, "..")

this does

abspath(builddir, "..")
  • Also, for some reason makensis kept throwing not file or directory [ENOENT] at me even though the file was there so i had to download a NSIS software, load the script and build the installer manually.

After those fixes i made everything work and managed to build a Windows Executable Application with an Installer but let me know your thoughts about this, i will be making a Pull Request with the above changes because it definitely will crash on other Windows 10 users.

gabrielfreire avatar May 01 '19 11:05 gabrielfreire

Wow, thanks so much for this detailed feedback!!!! <3 <3 <3

I'm sorry I haven't responded. I'll start looking at incorporating this over the next couple days. :) Thanks for the reports!

#57 looks good, i'll get to it now. :)

NHDaly avatar May 09 '19 21:05 NHDaly