/
win-installer.jl
40 lines (28 loc) · 900 Bytes
/
win-installer.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function win_installer(builddir; name = "nothing",
license = "$JULIA_HOME/../License.md")
# check = success(`makensis`)
# !check && throw(ErrorException("NSIS not found in path. Exiting."))
nsis_commands = """
# set the name of the installer
Outfile "$(name)_Installer.exe"
# Default install directory
InstallDir "\$LOCALAPPDATA"
Page license
Page directory
Page instfiles
LicenseData "$license"
# create a default section.
Section "Install"
SetOutPath "$(joinpath("\$INSTDIR", name))"
File /nonfatal /a /r "$builddir"
CreateShortcut "$(joinpath("\$INSTDIR", name, "$name.lnk"))" "$(joinpath(builddir, "core", "blink.exe"))"
SectionEnd
"""
@info "Creating installer at $builddir"
nsis_file = joinpath(builddir, "..", "$name.nsi")
open(nsis_file, "w") do f
write(f, nsis_commands)
end
run(`makensis $nsis_file`)
@info "Created installer successfully."
end