cbklib

Check-in [a75134832a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor updates
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a75134832a523be9962f5996dcb64b86ceb35214
User & Date: admin 2015-09-20 05:07:08
Context
2015-10-09
02:06
Updates of various libs check-in: 7360c31fb1 user: admin tags: trunk
2015-09-20
05:07
Minor updates check-in: a75134832a user: admin tags: trunk
02:09
tweak softwareupdate check-in: 2dd7444328 user: admin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to regproc/regproc.tcl.

    98     98   	variable appname
    99     99   	variable appstore
   100    100   
   101    101   	toplevel .purchase
   102    102   	wm title .purchase "Purchase $appname"
   103    103   	wm resizable .purchase 0 0
   104    104   
          105  +	regproc::makeModal .purchase
          106  +
   105    107   	wm withdraw .purchase
   106    108   	wm transient .purchase .
   107    109   
   108    110   	wm protocol .purchase WM_DELETE_WINDOW {}
   109    111   
   110    112   	ttk::frame .purchase.top -padding 10
   111    113   	pack .purchase.top -side top -fill both -expand yes
................................................................................
   146    148   	variable appname
   147    149   	variable appstore
   148    150   	variable expired
   149    151   
   150    152   	toplevel .expired
   151    153   	wm title .expired "Purchase $appname"
   152    154   	wm resizable .expired 0 0
          155  +
          156  +	regproc::makeModal .expired
   153    157   
   154    158   	wm withdraw .expired
   155    159   	wm transient .expired .
   156    160   
   157    161   	wm protocol .expired WM_DELETE_WINDOW {}
   158    162   
   159    163   	ttk::frame .expired.top -padding 10
................................................................................
   354    358   
   355    359       proc exitIfExpired {} {
   356    360   
   357    361   	variable expired
   358    362   	if {$expired == 1} {
   359    363   	    exit
   360    364   	} 
          365  +
          366  +    }
          367  +
          368  +    proc makeModal {w} {
          369  +
          370  +	if {[tk windowingsystem] eq "aqua" } {
          371  +	    tk::unsupported::MacWindowStyle style $w  modal
          372  +	}
          373  +	if {[tk windowingsystem] eq "win32"} {
          374  +	    raise $w
          375  +	    grab -global $w
          376  +	}
   361    377   
   362    378       }
   363    379   
   364    380       namespace export *
   365    381   }
   366    382   

Changes to softwareupdate/softwareupdate.tcl.

    12     12   
    13     13       if {![info exists library]} {
    14     14   	variable library [file dirname [info script]]
    15     15       }
    16     16   
    17     17   
    18     18       variable icon
    19         -	variable appname
           19  +    variable appname
    20     20       variable tmpdir
    21     21       variable currentinstall
    22     22       
    23     23       switch [tk windowingsystem] {
    24     24   	"aqua" {
    25     25   	    set tmpdir $::env(TMPDIR)
    26     26   
................................................................................
    31     31   	}
    32     32   	
    33     33   	"x11" {
    34     34   	    set tmpdir $::env(TMP)
    35     35   	}
    36     36       }
    37     37       
    38         -   proc setIcon {appicon} {
           38  +    proc setIcon {appicon} {
    39     39   	
    40     40   	variable icon
    41     41   	set icon $appicon
    42     42   	return $icon
    43     43       }
    44     44   
    45     45       proc setAppName {name} {
................................................................................
    83     83   
    84     84   	set changedata [$sparkledata selectNodes {string(//description/text())}]
    85     85   
    86     86   	set minOS [$sparkledata selectNodes -namespaces [list x "http://www.andymatuschak.org/xml-namespaces/sparkle"] {string(//x:minimumSystemVersion)}]
    87     87   
    88     88   
    89     89   	if {[tk windowingsystem] eq "aqua"] {
    90         -	set hostOS [exec sw_vers -productVersion]
           90  +	    set hostOS [exec sw_vers -productVersion]
    91     91   
    92         -	if {![package vsatisfies $hostOS $minOS]} {
    93         -	    tk_messageBox -icon warning -message "Error!" -detail "$appname is not supported on Mac OS X $hostOS. The minimum supported OS version is $minOS." 
    94         -	    return
    95         -	}
           92  +	    if {![package vsatisfies $hostOS $minOS]} {
           93  +		tk_messageBox -icon warning -message "Error!" -detail "$appname is not supported on Mac OS X $hostOS. The minimum supported OS version is $minOS." 
           94  +		return
           95  +	    }
    96     96   	}
    97     97   	
    98     98   	if {[expr $currentversion < $versionnumber]} {
    99     99   	    softwareupdate::updatePitch
   100    100   	} else {
   101    101   	    softwareupdate::upToDate
   102    102   	}
   103    103       }
          104  +}
          105  +
          106  +#define the current version of the software
          107  +proc setVersion {app number} {
          108  +    variable currentversion
          109  +    variable appname
          110  +    set currentversion $number
          111  +    set appname $app
   104    112       
   105         -    #define the current version of the software
   106         -    proc setVersion {app number} {
   107         -	variable currentversion
   108         -	variable appname
   109         -	set currentversion $number
   110         -	set appname $app
          113  +}
          114  +
          115  +
          116  +#get the current installation path
          117  +proc findCurrentInstallation {} {
          118  +    variable currentinstall
          119  +    variable appname 
          120  +    switch [tk windowingsystem] {
          121  +
          122  +	"aqua" {
          123  +	    set approot [info nameofexecutable]
          124  +	    set apppath [split $approot /]
          125  +	    set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]
          126  +	}
          127  +	
          128  +	"win32" {
          129  +	    set currentinstall [file join $::env(APPDATA)  CodebyKevin $appname]
          130  +	    
          131  +	}
   111    132   	
          133  +	"x11" {
          134  +	    return
          135  +	}
   112    136       }
   113    137       
   114         -
   115         -   #get the current installation path
   116         -    proc findCurrentInstallation {} {
   117         -	variable currentinstall
   118         -	variable appname 
   119         -	switch [tk windowingsystem] {
   120         -
   121         -	    "aqua" {
   122         -		set approot [info nameofexecutable]
   123         -		set apppath [split $approot /]
   124         -		set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]
   125         -	    }
          138  +    return $currentinstall
          139  +
          140  +}
          141  +
          142  +#prompt user to update
          143  +proc updatePitch {} {
          144  +    variable appname
          145  +    variable icon
          146  +    variable changedata
          147  +    variable currentversion
          148  +    variable versionnumber
          149  +
          150  +    catch {destroy .updateprogress}
          151  +
          152  +    catch {destroy .update}
          153  +    
          154  +
          155  +    toplevel .update
          156  +    wm title .update "Software Update"
          157  +
          158  +    wm withdraw .update
          159  +
          160  +    frame .update.f -bg gray95
          161  +    pack .update.f -fill both -expand yes
          162  +
          163  +    frame .update.f.top -bg gray95
          164  +    pack .update.f.top -fill both -expand yes
          165  +
          166  +    label .update.f.top.i -image $icon -bg gray95 -relief flat -highlightthickness 0
          167  +    pack .update.f.top.i -side left -fill both -expand yes
          168  +
          169  +    frame .update.f.top.r -bg gray95
          170  +    pack .update.f.top.r -side right -fill both -expand yes
          171  +
          172  +    label .update.f.top.r.title -text "A new version of $appname is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
          173  +    pack .update.f.top.r.title -fill both -expand yes -side top
          174  +
          175  +    label .update.f.top.r.msg -text "$appname $versionnumber is available--you have $currentversion. Would you like to download it now?" -font {-size 10} -bg gray95 -relief flat -highlightthickness 0
          176  +    pack .update.f.top.r.msg -fill both -expand yes -side top
          177  +
          178  +    label .update.f.top.r.release -text "Release Notes:" -font {-size 10 -weight bold} -relief flat -highlightthickness 0 -bg gray95 
          179  +    pack .update.f.top.r.release -side top -fill both -expand yes
          180  +
          181  +    text .update.f.top.r.text -font TkDefaultFont
          182  +    pack .update.f.top.r.text -side top -fill both -expand yes
          183  +
          184  +    ttk::frame .update.f.top.r.bottom -padding 5
          185  +    pack .update.f.top.r.bottom -side bottom -fill both -expand yes
          186  +
          187  +    ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}
          188  +
          189  +    ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
          190  +    
          191  +    pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes
          192  +
          193  +    .update.f.top.r.text insert end $changedata
          194  +
          195  +    .update.f.top.r.text configure -state disabled
          196  +
          197  +    wm resizable .update 0 0
          198  +    wm deiconify .update
          199  +    raise .update
          200  +    wm transient .update .
          201  +
          202  +}
          203  +
          204  +
          205  +#"busy" dialog
          206  +proc checkingForUpdates {} {
          207  +
          208  +    variable appname
          209  +    variable icon
          210  +
          211  +    catch {destroy .updateprogress}
          212  +
          213  +    toplevel .updateprogress 
          214  +    wm title .updateprogress "Updating $appname"
          215  +
          216  +    wm withdraw .updateprogress
          217  +    update idletasks
          218  +
          219  +    ttk::frame .updateprogress.f -padding 5
          220  +    pack .updateprogress.f -fill both -expand yes
          221  +
          222  +    label .updateprogress.f.l -bg gray95 -image $icon -bd 0 -relief flat -highlightthickness 0 -width [image width $icon] -height [image height $icon]
          223  +    pack .updateprogress.f.l -side left -fill both -expand yes
          224  +
          225  +    frame .updateprogress.f.r -bg gray95 -bd 0 -highlightcolor gray95
          226  +    pack .updateprogress.f.r -side right -fill both -expand yes
          227  +    
          228  +    
          229  +    ttk::label .updateprogress.f.r.t -text "Checking for updates..." -padding 5
          230  +    pack .updateprogress.f.r.t -side top -fill both -expand yes
          231  +
          232  +    ttk::frame .updateprogress.f.r.f -padding 5
          233  +    pack .updateprogress.f.r.f -side top -fill both -expand yes
          234  +    
          235  +    ttk::progressbar .updateprogress.f.r.f.progress -mode indeterminate -orient horizontal
          236  +    pack .updateprogress.f.r.f.progress -fill both -expand yes -side top
          237  +
          238  +    .updateprogress.f.r.f.progress start
          239  +
          240  +    ttk::button .updateprogress.f.r.f.b -text "Cancel" -command {destroy .updateprogress}
          241  +
          242  +    pack .updateprogress.f.r.f.b -side bottom -fill both -expand no
          243  +
          244  +    wm geometry .updateprogress 400x100
          245  +    wm resizable .updateprogress 0 0
          246  +
          247  +    wm deiconify .updateprogress
          248  +    raise .updateprogress
          249  +
          250  +    wm transient .updateprogress .
          251  +
          252  +}
          253  +
          254  +#dialog if current version is installed
          255  +proc upToDate {} {
          256  +    variable appname
          257  +    variable versionnumber
          258  +
          259  +    catch {destroy .updateprogress}
          260  +
          261  +    tk_messageBox  -icon info -message "You're up to date!" -detail "$appname $versionnumber is the currently the newest version available."
          262  +
          263  +}
          264  +
          265  +#show progress of installation
          266  +proc progressDialog {} {
          267  +
          268  +    variable appname
          269  +    variable status
          270  +    variable icon
          271  +
          272  +    catch {destroy .downloadprogress}
          273  +
          274  +    toplevel .downloadprogress
          275  +    wm title .downloadprogress "Updating $appname"
          276  +
          277  +    wm transient .downloadprogress .
          278  +
          279  +    label .downloadprogress.label -image $icon  -anchor w -bg gray95 -highlightthickness 0
          280  +
          281  +    pack .downloadprogress.label -side left -fill both -expand yes
          282  +
          283  +
          284  +    ttk::frame .downloadprogress.frame -padding 5
          285  +    pack .downloadprogress.frame -side right -fill both -expand yes
          286  +
          287  +    ttk::label .downloadprogress.frame.l -textvariable softwareupdate::status -width 40 -text ""
          288  +    pack .downloadprogress.frame.l -side top -fill both -expand yes
          289  +
          290  +    ttk::progressbar .downloadprogress.frame.bar -mode indeterminate -orient horizontal  -maximum 100
          291  +    pack .downloadprogress.frame.bar -side top -fill both -expand yes
          292  +
          293  +    .downloadprogress.frame.bar start
          294  +    update
          295  +
          296  +    ttk::button .downloadprogress.frame.b -text "Cancel" -command {destroy .updateprogress}
          297  +    pack .downloadprogress.frame.b -side right -fill both -expand no
          298  +
          299  +    wm geometry .downloadprogress 400x100
          300  +    wm resizable .downloadprogress 0 0
          301  +    
          302  +}
          303  +
          304  +#download and install the update
          305  +proc installUpdate {} {
          306  +    variable currentinstall
          307  +    variable status
          308  +    variable appname
          309  +    variable tmpdir
          310  +
          311  +    catch {destroy .update}
          312  +
          313  +    softwareupdate::findCurrentInstallation
          314  +
          315  +    softwareupdate::progressDialog
          316  +    set status "Downloading update for $appname"
          317  +    
          318  +    switch [tk windowingsystem] {
          319  +
          320  +	"aqua" {
          321  +	    http::geturl http://www.codebykevin.com/updates/[list $appname].tgz -channel [open $tmpdir/[list $appname].tgz w] 
          322  +	    update
          323  +	    after 1000
          324  +	    cd $tmpdir
          325  +	    set status "Unpacking update for $appname"
          326  +	    update
          327  +	    after 1000
          328  +	    catch {exec tar xvfz [list $appname].tgz}
          329  +	}
          330  +	
          331  +	"win32" {
   126    332   	    
   127         -	    "win32" {
   128         -		set currentinstall [file join $::env(APPDATA)  CodebyKevin $appname]
   129         -		
   130         -	    }
   131         -	    
   132         -	    "x11" {
   133         -		return
   134         -	    }
          333  +	    http::geturl http://www.codebykevin.com/updates/[list $appname].exe -channel [open $tmpdir/[list $appname].exe w] 
          334  +
   135    335   	}
   136    336   	
   137         -	return $currentinstall
   138         -
   139         -    }
   140         -
   141         -    #prompt user to update
   142         -    proc updatePitch {} {
   143         -	variable appname
   144         -	variable icon
   145         -	variable changedata
   146         -	variable currentversion
   147         -	variable versionnumber
   148         -
   149         -	catch {destroy .updateprogress}
   150         -
   151         -	catch {destroy .update}
   152         -	
   153         -
   154         -	toplevel .update
   155         -	wm title .update "Software Update"
   156         -
   157         -	wm withdraw .update
   158         -
   159         -	frame .update.f -bg gray95
   160         -	pack .update.f -fill both -expand yes
   161         -
   162         -	frame .update.f.top -bg gray95
   163         -	pack .update.f.top -fill both -expand yes
   164         -
   165         -	label .update.f.top.i -image $icon -bg gray95 -relief flat -highlightthickness 0
   166         -	pack .update.f.top.i -side left -fill both -expand yes
   167         -
   168         -	frame .update.f.top.r -bg gray95
   169         -	pack .update.f.top.r -side right -fill both -expand yes
   170         -
   171         -	label .update.f.top.r.title -text "A new version of $appname is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
   172         -	pack .update.f.top.r.title -fill both -expand yes -side top
   173         -
   174         -	label .update.f.top.r.msg -text "$appname $versionnumber is available--you have $currentversion. Would you like to download it now?" -font {-size 10} -bg gray95 -relief flat -highlightthickness 0
   175         -	pack .update.f.top.r.msg -fill both -expand yes -side top
   176         -
   177         -	label .update.f.top.r.release -text "Release Notes:" -font {-size 10 -weight bold} -relief flat -highlightthickness 0 -bg gray95 
   178         -	pack .update.f.top.r.release -side top -fill both -expand yes
   179         -
   180         -	text .update.f.top.r.text -font TkDefaultFont
   181         -	pack .update.f.top.r.text -side top -fill both -expand yes
   182         -
   183         -	ttk::frame .update.f.top.r.bottom -padding 5
   184         -	pack .update.f.top.r.bottom -side bottom -fill both -expand yes
   185         -
   186         -	ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}
   187         -
   188         -	ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
   189         -	
   190         -	pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes
   191         -
   192         -        .update.f.top.r.text insert end $changedata
   193         -
   194         -	.update.f.top.r.text configure -state disabled
   195         -
   196         -	wm resizable .update 0 0
   197         -	wm deiconify .update
   198         -	raise .update
   199         -	wm transient .update .
   200         -
   201         -    }
   202         -
   203         -
   204         -    #"busy" dialog
   205         -    proc checkingForUpdates {} {
   206         -
   207         -	variable appname
   208         -	variable icon
   209         -
   210         -	catch {destroy .updateprogress}
   211         -
   212         -	toplevel .updateprogress 
   213         -	wm title .updateprogress "Updating $appname"
   214         -
   215         -	wm withdraw .updateprogress
   216         -	update idletasks
   217         -
   218         -	ttk::frame .updateprogress.f -padding 5
   219         -	pack .updateprogress.f -fill both -expand yes
   220         -
   221         -	label .updateprogress.f.l -bg gray95 -image $icon -bd 0 -relief flat -highlightthickness 0
   222         -	pack .updateprogress.f.l -side left -fill both -expand yes
   223         -
   224         -	frame .updateprogress.f.r -bg gray95 -bd 0 -highlightcolor gray95
   225         -	pack .updateprogress.f.r -side right -fill both -expand yes
   226         -	
   227         -	
   228         -	ttk::label .updateprogress.f.r.t -text "Checking for updates..." -padding 5
   229         -	pack .updateprogress.f.r.t -side top -fill both -expand yes
   230         -
   231         -	ttk::frame .updateprogress.f.r.f -padding 5
   232         -	pack .updateprogress.f.r.f -side top -fill both -expand yes
   233         -	
   234         -	ttk::progressbar .updateprogress.f.r.f.progress -mode indeterminate -orient horizontal
   235         -	pack .updateprogress.f.r.f.progress -fill both -expand yes -side top
   236         -
   237         -	.updateprogress.f.r.f.progress start
   238         -
   239         -	ttk::button .updateprogress.f.r.f.b -text "Cancel" -command {destroy .updateprogress}
   240         -
   241         -	pack .updateprogress.f.r.f.b -side bottom -fill both -expand no
   242         -
   243         -	wm geometry .updateprogress 400x100
   244         -	wm resizable .updateprogress 0 0
   245         -
   246         -	wm deiconify .updateprogress
   247         -	raise .updateprogress
   248         -
   249         -	wm transient .updateprogress .
   250         -
          337  +	"x11" {
          338  +	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
          339  +	    return
          340  +	}
   251    341       }
   252    342       
   253         -    #dialog if current version is installed
   254         -    proc upToDate {} {
   255         -	variable appname
   256         -	variable versionnumber
          343  +    
          344  +    set status "Ready to install"
          345  +    .downloadprogress.frame.bar configure -mode determinate
          346  +    .downloadprogress.frame.bar configure -value 100
          347  +    .downloadprogress.frame.bar stop
          348  +    destroy .downloadprogress.frame.b 
          349  +    pack [ttk::button .downloadprogress.frame.b -text "Install and Relaunch" -command softwareupdate::launchUpdate] -side right -fill both -expand no
          350  +    return
          351  +}
          352  +
          353  +
          354  +#launch the update
          355  +proc launchUpdate {}  {
          356  +
          357  +    variable currentinstall
          358  +    variable appname
          359  +    variable tmpdir
          360  +    
          361  +    switch [tk windowingsystem] {
   257    362   
   258         -	catch {destroy .updateprogress}
          363  +	"aqua" {
          364  +	    if {[catch {exec codesign -v $tmpdir/$appname.app} msg]} {
          365  +		bgerror $msg
          366  +		tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later."
          367  +		return
          368  +	    } else {
   259    369   
   260         -	tk_messageBox  -icon info -message "You're up to date!" -detail "$appname $versionnumber is the currently the newest version available."
   261         -
   262         -    }
          370  +		file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]]
   263    371   
   264         -    #show progress of installation
   265         -    proc progressDialog {} {
   266         -
   267         -	variable appname
   268         -	variable status
   269         -
   270         -	catch {destroy .downloadprogress}
          372  +		file rename -force /tmp/$appname.app $currentinstall
   271    373   
   272         -	toplevel .downloadprogress
   273         -	wm title .downloadprogress "Updating $appname"
   274         -
   275         -	wm transient .downloadprogress .
   276         -
   277         -	label .downloadprogress.label -bitmap myicon   -anchor w -bg gray95 -highlightthickness 0
   278         -
   279         -	pack .downloadprogress.label -side left -fill both -expand yes
   280         -
   281         -
   282         -	ttk::frame .downloadprogress.frame -padding 5
   283         -	pack .downloadprogress.frame -side right -fill both -expand yes
   284         -
   285         -	ttk::label .downloadprogress.frame.l -textvariable softwareupdate::status -width 40 -text ""
   286         -	pack .downloadprogress.frame.l -side top -fill both -expand yes
          374  +		exec $currentinstall/Contents/MacOS/$appname &
   287    375   
   288         -	ttk::progressbar .downloadprogress.frame.bar -mode indeterminate -orient horizontal  -maximum 100
   289         -	pack .downloadprogress.frame.bar -side top -fill both -expand yes
   290         -
   291         -	.downloadprogress.frame.bar start
   292         -	update
   293         -
   294         -	ttk::button .downloadprogress.frame.b -text "Cancel" -command {destroy .updateprogress}
   295         -	pack .downloadprogress.frame.b -side right -fill both -expand no
   296         -
   297         -	wm geometry .downloadprogress 400x100
   298         -        wm resizable .downloadprogress 0 0
   299         -	
   300         -    }
   301         -
   302         -    #download and install the update
   303         -    proc installUpdate {} {
   304         -	variable currentinstall
   305         -	variable status
   306         -	variable appname
   307         -	variable tmpdir
   308         -
   309         -	catch {destroy .update}
   310         -
   311         -	softwareupdate::findCurrentInstallation
   312         -
   313         -	softwareupdate::progressDialog
   314         -	set status "Downloading update for $appname"
   315         -	
   316         -	switch [tk windowingsystem] {
   317         -
   318         -	    "aqua" {
   319         -		http::geturl http://www.codebykevin.com/updates/[list $appname].tgz -channel [open $tmpdir/[list $appname].tgz w] 
   320         -		update
   321         -		after 1000
   322         -		cd $tmpdir
   323         -		set status "Unpacking update for $appname"
   324         -		update
   325         -		after 1000
   326         -		catch {exec tar xvfz [list $appname].tgz}
   327         -	    }
   328         -	    
   329         -	    "win32" {
   330         -		
   331         -		http::geturl http://www.codebykevin.com/updates/[list $appname].exe -channel [open $tmpdir/[list $appname].exe w] 
   332         -
   333         -	    }
   334         -	    
   335         -	    "x11" {
   336         -		tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
   337         -		return
          376  +		exit
   338    377   	    }
   339    378   	}
   340    379   	
          380  +	"win32" {
          381  +	    
          382  +	    file rename -force $currentinstall/[list $appname].exe $tmpdir/[list $appname].exe~
          383  +	    file copy $tmpdir/[list $appname].exe $currentinstall/[list $appname.exe]
          384  +	    exec $currentinstall/[list $appname].exe &
          385  +	    exit
          386  +	}
   341    387   	
   342         -	set status "Ready to install"
   343         -	.downloadprogress.frame.bar configure -mode determinate
   344         -	.downloadprogress.frame.bar configure -value 100
   345         -	.downloadprogress.frame.bar stop
   346         -	destroy .downloadprogress.frame.b 
   347         -	pack [ttk::button .downloadprogress.frame.b -text "Install and Relaunch" -command softwareupdate::launchUpdate] -side right -fill both -expand no
   348         -	return
          388  +	"x11" {
          389  +	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
          390  +	    return
          391  +	}
   349    392       }
   350    393   
          394  +    catch {destroy .downloadprogress}
   351    395   
   352         -    #launch the update
   353         -    proc launchUpdate {}  {
          396  +    
   354    397   
   355         -	variable currentinstall
   356         -	variable appname
   357         -	variable tmpdir
   358         -	
   359         -	switch [tk windowingsystem] {
          398  +}
   360    399   
   361         -	    "aqua" {
   362         -		if {[catch {exec codesign -v $tmpdir/$appname.app} msg]} {
   363         -		    bgerror $msg
   364         -		    tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later."
   365         -		    return
   366         -		} else {
   367         -
   368         -		    file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]]
   369         -
   370         -		    file rename -force /tmp/$appname.app $currentinstall
   371         -
   372         -		    exec $currentinstall/Contents/MacOS/$appname &
   373         -
   374         -		    exit
   375         -		}
   376         -	    }
   377         -	    
   378         -	    "win32" {
   379         -		
   380         -		file rename -force $currentinstall/[list $appname].exe $tmpdir/[list $appname].exe~
   381         -		file copy $tmpdir/[list $appname].exe $currentinstall/[list $appname.exe]
   382         -		exec $currentinstall/[list $appname].exe &
   383         -		exit
   384         -	    }
   385         -	    
   386         -	    "x11" {
   387         -		tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
   388         -		return
   389         -	    }
   390         -	}
   391         -
   392         -	catch {destroy .downloadprogress}
   393         -
   394         -	
   395         -
   396         -    }
   397         -
   398         -    namespace export *
          400  +namespace export *
   399    401   
   400    402   }

Changes to xplat/xplat.tcl.

    11     11   
    12     12   	switch [tk windowingsystem] {
    13     13   
    14     14   	    "x11" {
    15     15   		exec lpr [list $filename]
    16     16   	    }
    17     17   	    "win32" {
    18         -		auto_execok start  /min notepad /p [list $filename]
           18  +		eval exec [auto_execok start]  /min notepad /p [list $filename]
    19     19   	    }
    20     20   	    
    21     21   	    "aqua" {
    22     22   		package require cocoaprint
    23     23   		cocoaprint::cocoaprint [list $filename] .
    24     24   	    }
    25     25   	}
................................................................................
    30     30       proc launch {filename} {
    31     31   	switch [tk windowingsystem] {
    32     32   
    33     33   	    "x11" {
    34     34   		exec xdg-open [list $filename]
    35     35   	    }
    36     36   	    "win32" {
    37         -		auto_execok start {} [list $filename]
           37  +		eval exec [auto_execok start] [list $filename]
    38     38   	    }
    39     39   	    
    40     40   	    "aqua" {
    41     41   		exec open $filename
    42     42   	    }
    43     43   	}
    44     44       }
................................................................................
    65     65       proc appconfig {appname} {
    66     66   	switch [tk windowingsystem] {
    67     67   
    68     68   	    "x11" {
    69     69   		return [file join $::env(HOME) "." [string tolower  "$appname"]]
    70     70   	    }
    71     71   	    "win32" {
    72         -		return [file join $::env(APPDATA) "CodebyKevin" "$appname"_config]
    73         -	    } 
           72  +		return [file join $::env(APPDATA) "$appname"]
           73  +	    }
    74     74   	    
    75     75   	    "aqua" {
    76     76   		return [file join $::env(HOME) "Library" "Application Support" "$appname" "Preferences"]
    77     77   	    }   
    78     78   	}
    79     79       }
    80     80