Skip to content

Commit

Permalink
Added setting OCRAN_EXECUTABLE on script startup for InnoSetup instal…
Browse files Browse the repository at this point in the history
…ler build
  • Loading branch information
shinokaro committed Jun 7, 2024
1 parent 094b6ac commit 449a6e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ocran/inno_setup_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 449a6e5

Please sign in to comment.