mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-06 04:54:29 +08:00
1. Replace `mix release mac_app|mac_app_dmg|windows_installer` with a single `mix release app` 2. Extract templates (Launcher.swift, Launcher.vbs, etc) into separate files in app_builder/lib/templates 3. Don't verify vc_redist.x64.exe checksum as the Microsoft publishes new releases on the same URL
48 lines
1.6 KiB
Elixir
48 lines
1.6 KiB
Elixir
' This vbs script avoids a flashing cmd window when launching the release bat file
|
|
|
|
root = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName) - Len(Wscript.ScriptName))
|
|
script = root & "rel\bin\<%= @release.name %>.bat"
|
|
|
|
Set shell = CreateObject("WScript.Shell")
|
|
|
|
' Below we run two commands:
|
|
'
|
|
' 1. bin/release rpc
|
|
' 2. bin/release start
|
|
'
|
|
' The first one will only succeed when the app is already running. The second one when it is not.
|
|
' It's ok for either to fail because we run them asynchronously.
|
|
|
|
Set env = shell.Environment("Process")
|
|
env("PATH") = "<%= Enum.map_join(@app_options[:additional_paths], ";", &String.replace(&1, "/", "\\")) %>" & env("PATH")
|
|
|
|
If WScript.Arguments.Count > 0 Then
|
|
input = WScript.Arguments(0)
|
|
Else
|
|
input = "reopen_app"
|
|
End If
|
|
|
|
' Below, we're basically doing:
|
|
'
|
|
' $ bin/release rpc 'AppBuilder.Windows.__send_events__(MyApp, input)'
|
|
'
|
|
' We send the input through IO, as opposed using the rpc expression, to avoid RCE.
|
|
cmd = "echo " & input & " | """ & script & """ rpc ""AppBuilder.Windows.__send_events__(<%= inspect(@app_options[:server]) %>, String.trim(IO.read(:line)))"""
|
|
code = shell.Run("cmd /c " & cmd, 0)
|
|
|
|
' Below, we're basically doing:
|
|
'
|
|
' $ bin/release start
|
|
'
|
|
' We send the input through the environment variable as we can't easily access argv
|
|
' when booting through the release script.
|
|
|
|
If WScript.Arguments.Count > 0 Then
|
|
env("APP_BUILDER_INPUT") = WScript.Arguments(0)
|
|
Else
|
|
env("APP_BUILDER_INPUT") = "new_file"
|
|
End If
|
|
|
|
cmd = """" & script & """ start"
|
|
code = shell.Run("cmd /c " & cmd & " >> " & root & "\Logs\<%= @app_options[:name] %>.log 2>&1", 0)
|
|
|