Changeset 810


Ignore:
Timestamp:
Dec 4, 2009 5:12:26 PM (11 years ago)
Author:
toby
Message:

# on 2004/09/28 22:34:07, toby did:
use WINUTILS if present in place of WINEXEC
on Mac use Rez & SetFile? from dist, when not installed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    • Property rcs:date changed from 2004/09/20 15:32:20 to 2004/09/28 22:34:07
    • Property rcs:lines changed from +2 -2 to +34 -9
    • Property rcs:rev changed from 1.58 to 1.59
    r805 r810  
    24352435            return
    24362436        }
    2437         # pause is hard coded in the .BAT file
     2437        if {[info command winutils::shell] == "" && \
     2438                [info command winexec] == ""} {
     2439            MyMessageBox -parent . -title "Setup error" \
     2440                -message {Error -- Use "Neither WINEXEC not WINTILS were found. Can't do anything!"} \
     2441                -icon error -type darn -default darn \
     2442                -helplink "expgui_Win_readme.html Winexec"
     2443            return
     2444        }
     2445        # N. B. pause is now hard coded in the .BAT file
    24382446        #
    24392447        # loop over multiple commands
     
    24662474            # replace the forward slashes with backward
    24672475            regsub -all / $cmd \\ cmd
    2468             winexec -d [file nativename [pwd]] \
     2476            if {[info command winutils::shell] != ""} {
     2477                winutils::shell [file join $expgui(scriptdir) gsastcl.bat] $cmd
     2478            } else {
     2479                winexec -d [file nativename [pwd]] \
    24692480                    [file join $expgui(scriptdir) gsastcl.bat] $cmd
     2481            }
    24702482            if {$wait} {
    24712483                tkwait window .lock
     
    25802592    # required tool (Rez) are installed
    25812593    set app [file join $expgui(gsasdir) expgui.app]
    2582     if {[file exists $app] && [file exists /Developer/Tools/Rez]} {
     2594    if {[file exists /Developer/Tools/Rez]} {
     2595        set RezApp /Developer/Tools/Rez
     2596    } elseif {[file exists [file join $expgui(gsasdir) Rez]]} {
     2597        set RezApp [file join $expgui(gsasdir) Rez]
     2598    } else {
     2599        set RezApp {}
     2600    }
     2601    if {[file exists /Developer/Tools/SetFile]} {
     2602        set SetFileApp /Developer/Tools/SetFile
     2603    } elseif {[file exists [file join $expgui(gsasdir) SetFile]]} {
     2604        set SetFileApp [file join $expgui(gsasdir) SetFile]
     2605    } else {
     2606        set SetFileApp {}
     2607    }
     2608    if {[file exists $app] && $RezApp != ""} {
    25832609        # make a resource file
    25842610        set l [string length $app]; incr l
     
    25942620        puts $fp $str
    25952621        close $fp
    2596         exec /Developer/Tools/Rez setapp.r -o $expnative -a
     2622        exec $RezApp setapp.r -o $expnative -a
    25972623        file delete -force setapp.r
    25982624    }
     
    26002626    # assign an icon to the data file, if it and the required tools exist
    26012627    set icon [file join $expgui(gsasdir) gsasicon.r]
    2602     if {[file exists $icon] && [file exists /Developer/Tools/Rez] && \
    2603             [file exists /Developer/Tools/SetFile]} {
    2604         exec /Developer/Tools/Rez [file nativename $icon] -o $expnative -a
    2605         exec /Developer/Tools/SetFile -a C $expnative
    2606     }
    2607 }
     2628    if {[file exists $icon] && $RezApp != "" && $SetFileApp != ""} {
     2629        exec $RezApp [file nativename $icon] -o $expnative -a
     2630        exec $SetFileApp -a C $expnative
     2631    }
     2632}
Note: See TracChangeset for help on using the changeset viewer.