mkwinpeimg: Fix --start-script when script not in current directory
authorEric Biggers <ebiggers3@gmail.com>
Tue, 24 Dec 2013 07:24:43 +0000 (01:24 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 24 Dec 2013 07:24:43 +0000 (01:24 -0600)
programs/mkwinpeimg.in

index 388af41..5316efa 100755 (executable)
@@ -408,13 +408,13 @@ modify_boot_wim() {
 
        if [ -n "$start_script" ]; then
                stat_busy "Setting \"$start_script\" as the script to be executed when Windows PE boots"
-               cp "$start_script" "$tmp_dir/$start_script"
+               start_script_base="$(basename "$start_script")"
                cat > "$tmp_dir/__mkwinpeimg.winpeshl.ini" <<- EOF
                        [LaunchApps]
-                       %SYSTEMDRIVE%\\$start_script
+                       %SYSTEMDRIVE%\\$start_script_base
                EOF
                cat 1>&3 <<- EOF
-                       add '$tmp_dir/$start_script' '/$start_script'
+                       add '$start_script' '/$start_script_base'
                        delete --force /Windows/System32/winpeshl.ini
                        add '$tmp_dir/__mkwinpeimg.winpeshl.ini' /Windows/System32/winpeshl.ini
                EOF