From 449a6e5eacec71bbaabe7816e1d65f209d6c10a2 Mon Sep 17 00:00:00 2001 From: shinokaro Date: Fri, 7 Jun 2024 11:59:34 +0900 Subject: [PATCH] Added setting OCRAN_EXECUTABLE on script startup for InnoSetup installer build --- lib/ocran/inno_setup_builder.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ocran/inno_setup_builder.rb b/lib/ocran/inno_setup_builder.rb index 1abb4f5..cd41bcc 100644 --- a/lib/ocran/inno_setup_builder.rb +++ b/lib/ocran/inno_setup_builder.rb @@ -24,11 +24,16 @@ class AppLauncherBatchBuilder # batch file's own location without changing the working directory. BATCH_FILE_DIR = "%~dp0" + # BATCH_FILE_PATH is a parameter expansion used in Windows batch files, + # representing the full path to the batch file itself, including the file name. + BATCH_FILE_PATH = "%~f0" + def initialize(path, title, executable, script, *args, chdir_before: nil, environments: {}) @path = path File.open(@path, "w") do |f| f.puts "@echo off" environments.each { |name, val| f.puts build_set_command(name, val) } + f.puts build_set_command("OCRAN_EXECUTABLE", BATCH_FILE_PATH) f.puts build_start_command(title, executable, script, *args, chdir_before: chdir_before) f end