Manpower

Check-in [c116ab1db9]
Login

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

Overview
Comment:Tweaks
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c116ab1db9278e69387a6b382a887336586a7937
User & Date: kevin 2016-07-02 22:00:52
Context
2016-07-02
22:02
Fix copyright date, version number check-in: 8e6ce44afd user: kevin tags: trunk
22:00
Tweaks check-in: c116ab1db9 user: kevin tags: trunk
17:42
Update check-in: e6a44c8ae8 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

libs/manpower/images/bookmarks-organize.png became executable.

cannot compute difference between binary files

libs/manpower/images/copy_text.png became executable.

cannot compute difference between binary files

libs/manpower/images/font_name.png became executable.

cannot compute difference between binary files

libs/manpower/images/helpfind.png became executable.

cannot compute difference between binary files

libs/manpower/images/list-add.png became executable.

cannot compute difference between binary files

libs/manpower/images/list-remove.png became executable.

cannot compute difference between binary files

libs/manpower/images/preferences_other.png became executable.

cannot compute difference between binary files

libs/manpower/images/print.png became executable.

cannot compute difference between binary files

libs/manpower/images/save.png became executable.

cannot compute difference between binary files

Changes to libs/manpower/manpower-main.tcl.

83
84
85
86
87
88
89



90
91
92
93
94
95
96
    set bookdata  {
	R0lGODlhEAAQAPABAAAAAP///yH5BAEKAAEAIf4aQ3JlYXRlZCB3aXRoIEdJTVAg
	b24gYSBNYWMALAAAAAAQABAAAAIoDI6JYerHEpvzAUqXbJDz+0UPVoEb2Z1YupCN
	2KFmK8NgHbqsdfJbAQA7
    }

    image create photo book -data $bookdata





}


#draw the GUI
proc drawGUI {} {







>
>
>







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    set bookdata  {
	R0lGODlhEAAQAPABAAAAAP///yH5BAEKAAEAIf4aQ3JlYXRlZCB3aXRoIEdJTVAg
	b24gYSBNYWMALAAAAAAQABAAAAIoDI6JYerHEpvzAUqXbJDz+0UPVoEb2Z1YupCN
	2KFmK8NgHbqsdfJbAQA7
    }

    image create photo book -data $bookdata

    softwareupdate::setIcon [image create photo -data {iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAU9UlEQVR4Ae14d1TU5xL2GKMmakwsNzFRrl1jMXYxJhbF3guoiKKCJRYioAiKUhCkgIglUuzFGNFgoSDSixQRQQSkKIiCwMKCLIUtC883+zsEiAnf9eaPe853zvd4nrOvu8u888w7M+/sjwBQpX0vCnVfSMFucyjK5nsKslan0KOLKMhpHvlaT6UEz5WDi2IcCkRxLsgJMAmOdB7X2dtsANk6HCD7kx7k7GxPZ895tjl+4thE71u/GUZEhXk+jIv2jYuPiYiLfxgRGxfjx+95+dy5ZezheXrS2fOebZyPOpGV00m6aL+BHjuNoXiPxRR+Zu3wWA/NpXGei0b7HRreJsRsOB0/1Jv0DIl272kjcDOv7c26U6jtD4LvfxEQYT2ZHtiMp4e/zKWQYz9S0JFx9DbM9mWu797i+BNzLMSR1qhKdIXfycnDTc03k6ub+zC/IP8zz56liEVlJaiT1kJRr0AD/2uEsFYqlairq4WoVIS09NQK//t+52zdvIactVxMb28s3ySOsZMVhVujIMwGorijKIpyrHzsOnea5a4OtNKABBEqavHacl83CrdrTYDVJHpgr06PPDUp2kWdXvjqL3z78BjST09blHJ0DP1q3o8yQnZHZp7bVRa4bMGvBb6B+KfIyy+oTojye5sd6oSEM6vck9ynqCe7DRscZT1yfn7g3tf1mVfhc3Sy5tF9X5CXTX/ysu5Hp63V6JrNUAo6rP5XASFucyncQp3uHRxGEY4z6MXvu34UJ7vj5c0NyaJLP5LniZ20de8u8lk99UiphRUQlQBkpAFisRDv+oZ6NAhsaJXCd8CormZKoACQnZuL61d++cnCbDN5HFxCj6xH0I1tn1Dc+XXB1Y9PI3z/+M6hZhMo4uBkemg5lcIOTKJ7VmOaBUgcelPILwvonu0kCjkwiuLcl4wtjLR7/DbGBXk++nHS24vbXfIyJu1tJl381m5+Ir3gDeTmoyEjHbKgICiepqJFvvyt4xCIJihev4Y8KwsNomKoIGX6PI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uMcf0f+M2aHRtzZ/V8RtWoj4pJH05HezvGD3DU+pESNGff1DaaYzDk0ZWXiGqDrnpCsSxW8RGR2G4LAgBAXfx/2gAPgH+gqCmMI6MMifPwtUfUf4bnH5WyycPwcWNofREnKFEuxr6hGjmfmyLNdCIvq00a9PBN943ZqA90UIaWRjuNQRRV7o+ikNJEZOkHlubqRFCS+HM42nT5qY6Ojm1HA/xA+PU+Lx5GkiEhIfIiYuAlEPwxHJjI6NQDy/p/qhlJgcj6AQf5ge2CsZNmJY1Zs3BWiJPaYWMNEe1gB4Q2fuUOOmlH7P+dYENIloMYB1ygyxfFOd6oy46wZZKHDHxCFfziES0JM5mLmi59c9HecvmBtgsHtnlr2TXaW71ymcu3SGx+AzcPc8BXtHu0oDw51Z8xfOC/z6m6/tiGhK9+7d41RD3WUu7DNnzsDn9l1Mnz5TuWn+wN+W/Nh3bssBsaXzrQloTQh16diux53jmx6KIq0wf/IAHRIgHGmHFkVFjVH6svF0fuDnQbNUVK2ZI5hfCd9vxlzmFuYa5mrmRqYGNeOjvzreuoDWhfwFTSnWQWDLI/7PaJmibVrfs4kC/rmAVk+miW0b+fGHs+mJnR0/yXjFjO7du3d03759U3hiDSeibtSIfyzgH4j6cDZi+PDhqXgPPLnKhdr6BwL+h2hdAD+l+P8C/mfgh73/bwvo0qVLnKamJvgptWTFihWSdevWgQtaLLTiDxTwfwDvhpRMBkrQggAAAABJRU5ErkJggg==
}]


}


#draw the GUI
proc drawGUI {} {

Changes to libs/manpower/rman.

cannot compute difference between binary files

Changes to libs/regproc/regproc.tcl.

93
94
95
96
97
98
99


100
101

102
103
104
105
106
107
108
109
...
142
143
144
145
146
147
148

149


150

151
152


153
154
155
156
157
158
159
...
224
225
226
227
228
229
230

231
232
233
234
235
236
237
...
247
248
249
250
251
252
253

254
255
256
257
258
259
260

261
262
263
264
265
266
267
268
269
270
271
...
303
304
305
306
307
308
309

310



311
312

313
314
315
316

317
318
319
320
321
322
323
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
...
354
355
356
357
358
359
360













361
362
363
364
365
366
    }

    #dialog before demo has expired
    proc makePitch {} {
	variable version 
	variable appname
	variable appstore



	toplevel .purchase

	wm title .purchase "Purchase $appname"
	wm resizable .purchase 0 0

	wm withdraw .purchase
	wm transient .purchase .

	wm protocol .purchase WM_DELETE_WINDOW {}

................................................................................

    #dialog after demo has expired
    proc expiredPitch {} {
	variable version 
	variable appname
	variable appstore
	variable expired




	toplevel .expired

	wm title .expired "Purchase $appname"
	wm resizable .expired 0 0



	wm withdraw .expired
	wm transient .expired .

	wm protocol .expired WM_DELETE_WINDOW {}

	ttk::frame .expired.top -padding 10
................................................................................
    proc setLic {} {
	variable serial
	variable serialbase
	variable datadir
	variable appname
	variable regwindow
	variable appstore


	if {$serial == ""} {
	    tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. The application will exit now." -parent .number
	    exit
	}

	set count 20000
................................................................................
	puts $output
	
	if {$output >= 0} {
	    cd $datadir
	    set lic [open $datadir/lic.dat w]
	    puts $lic "$serial"
	    close $lic

	    tk_messageBox -icon info -title "Thank You" -message "Thank You" -detail "Thank you for registering $appname." -parent .number
	    destroy .number
	    #display window that was hidden
	    catch {wm deiconify .}

	} else {
	    if {$expired == 1} {

		tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. The application will exit now." -parent .number
		exit
	    }
	    
	    tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. Please try again." -parent .number
	    regproc::getReg
	}
    }



................................................................................


	variable serial
	variable regwindow
	variable appstore
	variable expired
	variable appname





	toplevel .number
	wm title .number "License"

	wm resizable .number 0 0

	wm withdraw .number
	wm transient .number .


	wm protocol .number WM_DELETE_WINDOW {}

	ttk::frame .number.top -padding 10
	pack .number.top -side top -fill both -expand yes

	
................................................................................
	ttk::frame .number.bottom.upper
	pack .number.bottom.upper -side top -fill both -expand no


	ttk::frame .number.bottom.lower -padding 5
	pack .number.bottom.lower -side bottom -fill both -expand no

	bind .number <Return> {regproc::setLic; destroy .number; raise .}
	ttk::button .number.bottom.lower.install -text "Register" -default active -command {regproc::setLic; destroy .number; raise .}
	ttk::button .number.bottom.lower.cancel -text "Cancel" -command "regproc::exitIfExpired; destroy .number; raise ."
	pack  .number.bottom.lower.install .number.bottom.lower.cancel  -side right -fill both -expand no
	
	::tk::PlaceWindow .number widget .

	wm deiconify .number
	focus .number.bottom.lower.install
	if {[tk windowingsystem] eq "aqua"} {
................................................................................

    proc exitIfExpired {} {

	variable expired
	if {$expired == 1} {
	    exit
	} 














    }

    namespace export *
}








>
>


>
|







 







>

>
>

>
|

>
>







 







>







 







>







>



|







 







>

>
>
>

|
>




>







 







|
|
|







 







>
>
>
>
>
>
>
>
>
>
>
>
>






93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
...
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
...
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
...
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
...
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
    }

    #dialog before demo has expired
    proc makePitch {} {
	variable version 
	variable appname
	variable appstore
	variable licensetitle
	set licensetitle "Purchase $appname"

	toplevel .purchase
	regproc::makeModal .purchase
	wm title .purchase $licensetitle
	wm resizable .purchase 0 0

	wm withdraw .purchase
	wm transient .purchase .

	wm protocol .purchase WM_DELETE_WINDOW {}

................................................................................

    #dialog after demo has expired
    proc expiredPitch {} {
	variable version 
	variable appname
	variable appstore
	variable expired
	variable licensetitle

	set licensetitle "Purchase $appname"

	toplevel .expired
	regproc::makeModal .expired
	wm title .expired $licensetitle
	wm resizable .expired 0 0



	wm withdraw .expired
	wm transient .expired .

	wm protocol .expired WM_DELETE_WINDOW {}

	ttk::frame .expired.top -padding 10
................................................................................
    proc setLic {} {
	variable serial
	variable serialbase
	variable datadir
	variable appname
	variable regwindow
	variable appstore
	variable expired

	if {$serial == ""} {
	    tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. The application will exit now." -parent .number
	    exit
	}

	set count 20000
................................................................................
	puts $output
	
	if {$output >= 0} {
	    cd $datadir
	    set lic [open $datadir/lic.dat w]
	    puts $lic "$serial"
	    close $lic
		grab release .number
	    tk_messageBox -icon info -title "Thank You" -message "Thank You" -detail "Thank you for registering $appname." -parent .number
	    destroy .number
	    #display window that was hidden
	    catch {wm deiconify .}

	} else {
	    if {$expired == 1} {
		grab release .number
		tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. The application will exit now." -parent .number
		exit
	    }
	    grab release .number
	    tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. Please try again." -parent .number
	    regproc::getReg
	}
    }



................................................................................


	variable serial
	variable regwindow
	variable appstore
	variable expired
	variable appname
	variable licensetitle

	set licensetitle "License" 

	catch {destroy .number}
	toplevel .number
	wm title .number $licensetitle
	regproc::makeModal .number
	wm resizable .number 0 0

	wm withdraw .number
	wm transient .number .
    

	wm protocol .number WM_DELETE_WINDOW {}

	ttk::frame .number.top -padding 10
	pack .number.top -side top -fill both -expand yes

	
................................................................................
	ttk::frame .number.bottom.upper
	pack .number.bottom.upper -side top -fill both -expand no


	ttk::frame .number.bottom.lower -padding 5
	pack .number.bottom.lower -side bottom -fill both -expand no

	bind .number <Return> {grab release .number; regproc::setLic;  raise .}
	ttk::button .number.bottom.lower.install -text "Register" -default active -command {grab release .number; regproc::setLic; raise .}
	ttk::button .number.bottom.lower.cancel -text "Cancel" -command "grab release .number; regproc::exitIfExpired; destroy .number; raise ."
	pack  .number.bottom.lower.install .number.bottom.lower.cancel  -side right -fill both -expand no
	
	::tk::PlaceWindow .number widget .

	wm deiconify .number
	focus .number.bottom.lower.install
	if {[tk windowingsystem] eq "aqua"} {
................................................................................

    proc exitIfExpired {} {

	variable expired
	if {$expired == 1} {
	    exit
	} 

    }

    proc makeModal {w} {

	variable licensetitle
	if {[tk windowingsystem] eq "aqua" } {
	    destroy $w; toplevel $w;  tk::unsupported::MacWindowStyle style $w  modal; wm title $w $licensetitle
	}
	if {[tk windowingsystem] eq "win32"} {
	    raise $w
	    grab -global $w
	}

    }

    namespace export *
}

Changes to libs/softwareupdate/softwareupdate.tcl.

12
13
14
15
16
17
18




































19
20
21
22
23
24
25
..
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
50
51
52
53
54
55
56


57
58
59
60
61
62
63

64


65












66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83




84
85
86











87
88
89
90








































































91
92
93
94
95
96
97
98
99
100
101
...
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152


153













154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
...
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
...
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255

256
257
258
259
260
261
262
263

264
265
266
267
268
269
270
271
272
273
274












275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

290
291

292

293
294
295
296
297
298
299
300
301
302
303
304
305
306











307
308
309
310
311
312
313
314

    if {![info exists library]} {
	variable library [file dirname [info script]]
    }


    variable icon





































    #check version of installed software
    proc checkVersion {app version} {
	variable appversion
	variable appname
	variable currentversion
	variable versionnumber
................................................................................
	variable appcast
	variable sparkledata
	variable changedata


	set appname $app

	set iconfile [file join [softwareupdate::findCurrentInstallation] "Contents" "Resources" $app.icns]

	tk::mac::iconBitmap myicon 64 64 -imageFile $iconfile

	softwareupdate::checkingForUpdates

	set appcast http://www.codebykevin.com/[string tolower $appname].xml
	http::config -useragent "$appname Update Check"

	set xml [http::data [http::geturl $appcast]]
................................................................................
	dom parse $xml sparkledata
	set versionnumber [string trim [$sparkledata selectNodes -namespaces [list x "http://www.andymatuschak.org/xml-namespaces/sparkle"] {string(//enclosure/@x:version)}] .0]

	set changedata [$sparkledata selectNodes {string(//description/text())}]

	set minOS [$sparkledata selectNodes -namespaces [list x "http://www.andymatuschak.org/xml-namespaces/sparkle"] {string(//x:minimumSystemVersion)}]



	set hostOS [exec sw_vers -productVersion]

	if {![package vsatisfies $hostOS $minOS]} {
	    tk_messageBox -icon warning -message "Error!" -detail "$appname is not supported on Mac OS X $hostOS. The minimum supported OS version is $minOS." 
	    return
	}
	

	if {[expr $currentversion < $versionnumber]} {


	    softwareupdate::updatePitch












	} else {
	    softwareupdate::upToDate
	}
    }
    
    #define the current version of the software
    proc setVersion {app number} {
	variable currentversion
	variable appname
	set currentversion $number
	set appname $app
	
    }
    

    #get the current installation path
    proc findCurrentInstallation {} {
	variable currentinstall




	set approot [info nameofexecutable]
	set apppath [split $approot /]
	set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]











	return $currentinstall

    }









































































    #prompt user to update
    proc updatePitch {} {
	variable appname
	variable myicon
	variable changedata
	variable currentversion
	variable versionnumber

	catch {destroy .updateprogress}

	catch {destroy .update}
................................................................................

	frame .update.f -bg gray95
	pack .update.f -fill both -expand yes

	frame .update.f.top -bg gray95
	pack .update.f.top -fill both -expand yes

	label .update.f.top.i -bitmap myicon -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.i -side left -fill both -expand yes

	frame .update.f.top.r -bg gray95
	pack .update.f.top.r -side right -fill both -expand yes

	label .update.f.top.r.title -text "A new version of $appname is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.r.title -fill both -expand yes -side top
................................................................................

	ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}

	ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
	
	pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes

        .update.f.top.r.text insert end $changedata

	.update.f.top.r.text configure -state disabled

	wm resizable .update 0 0
	wm deiconify .update
	raise .update
	wm transient .update .

    }

















    #"busy" dialog
    proc checkingForUpdates {} {

	variable appname


	catch {destroy .updateprogress}

	toplevel .updateprogress 
	wm title .updateprogress "Updating $appname"

	wm withdraw .updateprogress
	update idletasks

	ttk::frame .updateprogress.f -padding 5
	pack .updateprogress.f -fill both -expand yes

	label .updateprogress.f.l -bg gray95 -bitmap myicon -bd 0 -relief flat -highlightthickness 0
	pack .updateprogress.f.l -side left -fill both -expand yes

	frame .updateprogress.f.r -bg gray95 -bd 0 -highlightcolor gray95
	pack .updateprogress.f.r -side right -fill both -expand yes
	
	
	ttk::label .updateprogress.f.r.t -text "Checking for updates..." -padding 5
................................................................................

	wm deiconify .updateprogress
	raise .updateprogress

	wm transient .updateprogress .

    }
    
    #dialog if current version is installed
    proc upToDate {} {
	variable appname
	variable versionnumber

	catch {destroy .updateprogress}

	tk_messageBox  -icon info -message "You're up to date!" -detail "$appname $versionnumber is the currently the newest version available."

    }

    #show progress of installation
    proc progressDialog {} {

	variable appname
	variable status


	catch {destroy .downloadprogress}

	toplevel .downloadprogress
	wm title .downloadprogress "Updating $appname"

	wm transient .downloadprogress .

	label .downloadprogress.label -bitmap myicon   -anchor w -bg gray95 -highlightthickness 0

	pack .downloadprogress.label -side left -fill both -expand yes


	ttk::frame .downloadprogress.frame -padding 5
	pack .downloadprogress.frame -side right -fill both -expand yes

................................................................................
	.downloadprogress.frame.bar start
	update

	ttk::button .downloadprogress.frame.b -text "Cancel" -command {destroy .updateprogress}
	pack .downloadprogress.frame.b -side right -fill both -expand no

	wm geometry .downloadprogress 400x100
        wm resizable .downloadprogress 0 0
	
    }

    #download and install the update
    proc installUpdate {} {
	variable currentinstall
	variable status
	variable appname


	catch {destroy .update}

	softwareupdate::findCurrentInstallation

	variable appname
	variable status



        softwareupdate::progressDialog
	set status "Downloading update for $appname"
	http::geturl http://www.codebykevin.com/updates/[list $appname].tgz -channel [open /tmp/$appname.tgz w] 
	update
	after 1000
	cd /tmp
	set status "Unpacking update for $appname"
	update
	after 1000
	catch {exec tar xvfz [list $appname].tgz}












	set status "Ready to install"
	.downloadprogress.frame.bar configure -mode determinate
	.downloadprogress.frame.bar configure -value 100
	.downloadprogress.frame.bar stop
	destroy .downloadprogress.frame.b 
	pack [	ttk::button .downloadprogress.frame.b -text "Install and Relaunch" -command softwareupdate::launchUpdate] -side right -fill both -expand no
	return
    }


    #launch the update
    proc launchUpdate {}  {

	variable currentinstall
	variable appname


	catch {destroy .downloadprogress}



	if {[catch {exec codesign -v /tmp/$appname.app} msg]} {
	    bgerror $msg
	    tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later."
	    return
	} else {

	    file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]]

	    file rename -force /tmp/$appname.app $currentinstall

	    exec $currentinstall/Contents/MacOS/$appname &

	    exit
	}












    }

    

    namespace export *

}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
<
<







 







>
>
|
|
|
|
|
|
|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>




|








|




>
>
>
>
|
|
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|







 







|







 







|










>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>




>












|







 







|



|



|








>








|







 







|








>





|
|
|
>
|
<
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>





|









>
|
<
>
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>



<




12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
..
62
63
64
65
66
67
68



69
70
71
72
73
74
75
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
...
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
...
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420

421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489

490
491
492
493

    if {![info exists library]} {
	variable library [file dirname [info script]]
    }


    variable icon
    variable appname
    variable tmpdir
    variable currentinstall
    variable versionnumber
    
    switch [tk windowingsystem] {
	"aqua" {
	    set tmpdir $::env(TMPDIR)

	}
	
	"win32" {
	    set tmpdir $::env(TMP)
	}
	
	"x11" {
	    set tmpdir $::env(TMP)
	}
    }
    
    proc setIcon {appicon} {
	
	variable icon
	set icon $appicon
	return $icon
    }

    proc setAppName {name} {

	variable appname
	set appname $name
	return $appname

    }

    

    #check version of installed software
    proc checkVersion {app version} {
	variable appversion
	variable appname
	variable currentversion
	variable versionnumber
................................................................................
	variable appcast
	variable sparkledata
	variable changedata


	set appname $app





	softwareupdate::checkingForUpdates

	set appcast http://www.codebykevin.com/[string tolower $appname].xml
	http::config -useragent "$appname Update Check"

	set xml [http::data [http::geturl $appcast]]
................................................................................
	dom parse $xml sparkledata
	set versionnumber [string trim [$sparkledata selectNodes -namespaces [list x "http://www.andymatuschak.org/xml-namespaces/sparkle"] {string(//enclosure/@x:version)}] .0]

	set changedata [$sparkledata selectNodes {string(//description/text())}]

	set minOS [$sparkledata selectNodes -namespaces [list x "http://www.andymatuschak.org/xml-namespaces/sparkle"] {string(//x:minimumSystemVersion)}]


	if {[tk windowingsystem] eq "aqua"} {
	    set hostOS [exec sw_vers -productVersion]

	    if {![package vsatisfies $hostOS $minOS]} {
		tk_messageBox -icon warning -message "Error!" -detail "$appname is not supported on Mac OS X $hostOS. The minimum supported OS version is $minOS." 
		return
	    }
	}
	
	if {[expr $currentversion < $versionnumber]} {
	    switch [tk windowingsystem] {
		"aqua" {
		    softwareupdate::updatePitch

		}
		
		"win32" {
		    softwareupdate::winPitch $appname $currentversion $versionnumber
		}
		
		"x11" {
		    
		}
	    }
	    
	} else {
	    softwareupdate::upToDate
	}
    }

    #define the current version of the software
    proc setVersion {app number} {
	variable currentversion
	variable appname
	set currentversion $number
	set appname $app
	
    }


    #get the current installation path
    proc findCurrentInstallation {} {
	variable currentinstall
	variable appname 
	switch [tk windowingsystem] {

	    "aqua" {
		set approot [info nameofexecutable]
		set apppath [split $approot /]
		set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]
	    }
	    
	    "win32" {
		set currentinstall [file join $::env(APPDATA) ${appname}_App]  
	    }
	    
	    "x11" {
		return
	    }
	}
	
	return $currentinstall

    }

    #prompt user to update: for Perl, which chokes on XML parsing from Tcl
    proc updatePitchPerl {apptitle appnumber currentapp changelog} {
	variable appname
	variable icon
	variable changedata
	variable currentversion
	variable versionnumber
	variable changelist

	catch {destroy .updateprogress}

	catch {destroy .update}


	toplevel .update
	wm title .update "Software Update"

	wm withdraw .update

	frame .update.f -bg gray95
	pack .update.f -fill both -expand yes

	frame .update.f.top -bg gray95
	pack .update.f.top -fill both -expand yes

	label .update.f.top.i -image $icon -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.i -side left -fill both -expand yes

	frame .update.f.top.r -bg gray95
	pack .update.f.top.r -side right -fill both -expand yes

	label .update.f.top.r.title -text "A new version of $apptitle is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.r.title -fill both -expand yes -side top

	label .update.f.top.r.msg -text "$apptitle $appnumber is available--you have $currentapp. Would you like to download it now?" -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.r.msg -fill both -expand yes -side top

	label .update.f.top.r.release -text "Release Notes:" -font {-weight bold} -relief flat -highlightthickness 0 -bg gray95 
	pack .update.f.top.r.release -side top -fill both -expand yes

	text .update.f.top.r.text -font TkDefaultFont
	pack .update.f.top.r.text -side top -fill both -expand yes

	ttk::frame .update.f.top.r.bottom -padding 5
	pack .update.f.top.r.bottom -side bottom -fill both -expand yes

	ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}

	ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
	
	pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes

	set changetext [split $changelog *]

	set changetext [lrange $changetext 1 end]

	foreach item $changetext {
	    
	    .update.f.top.r.text insert end "* $item\n"

	}

	.update.f.top.r.text configure -state disabled

	wm resizable .update 0 0
	wm deiconify .update
	raise .update
	wm transient .update .

    }


    #prompt user to update
    proc updatePitch {} {
	variable appname
	variable icon
	variable changedata
	variable currentversion
	variable versionnumber

	catch {destroy .updateprogress}

	catch {destroy .update}
................................................................................

	frame .update.f -bg gray95
	pack .update.f -fill both -expand yes

	frame .update.f.top -bg gray95
	pack .update.f.top -fill both -expand yes

	label .update.f.top.i -image $icon -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.i -side left -fill both -expand yes

	frame .update.f.top.r -bg gray95
	pack .update.f.top.r -side right -fill both -expand yes

	label .update.f.top.r.title -text "A new version of $appname is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
	pack .update.f.top.r.title -fill both -expand yes -side top
................................................................................

	ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}

	ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
	
	pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes

	.update.f.top.r.text insert end $changedata

	.update.f.top.r.text configure -state disabled

	wm resizable .update 0 0
	wm deiconify .update
	raise .update
	wm transient .update .

    }

    proc winPitch {name newversion oldversion} {
	set answer [tk_messageBox  -icon info -title "New Version Available" -message "New Version Available" -detail "$name $newversion is available--you have $oldversion. Would you like to download it now?" -type yesno
		   ]

	switch -- $answer {
	    yes {

		xplat::launch http://www.codebykevin.com/$name.html
		destroy .updateprogress
	    }
	    no {
		destroy .updateprogress
		return
	    }
	}
    }
    #"busy" dialog
    proc checkingForUpdates {} {

	variable appname
	variable icon

	catch {destroy .updateprogress}

	toplevel .updateprogress 
	wm title .updateprogress "Updating $appname"

	wm withdraw .updateprogress
	update idletasks

	ttk::frame .updateprogress.f -padding 5
	pack .updateprogress.f -fill both -expand yes

	label .updateprogress.f.l -bg gray95 -image $icon -bd 0 -relief flat -highlightthickness 0 -width [image width $icon] -height [image height $icon]
	pack .updateprogress.f.l -side left -fill both -expand yes

	frame .updateprogress.f.r -bg gray95 -bd 0 -highlightcolor gray95
	pack .updateprogress.f.r -side right -fill both -expand yes
	
	
	ttk::label .updateprogress.f.r.t -text "Checking for updates..." -padding 5
................................................................................

	wm deiconify .updateprogress
	raise .updateprogress

	wm transient .updateprogress .

    }

    #dialog if current version is installed
    proc upToDate {} {
	variable appname
	variable currentversion

	catch {destroy .updateprogress}

	tk_messageBox  -icon info -title "Up to Date" -message "You're up to date!" -detail "$appname $currentversion is the currently the newest version available."

    }

    #show progress of installation
    proc progressDialog {} {

	variable appname
	variable status
	variable icon

	catch {destroy .downloadprogress}

	toplevel .downloadprogress
	wm title .downloadprogress "Updating $appname"

	wm transient .downloadprogress .

	label .downloadprogress.label -image $icon  -anchor w -bg gray95 -highlightthickness 0

	pack .downloadprogress.label -side left -fill both -expand yes


	ttk::frame .downloadprogress.frame -padding 5
	pack .downloadprogress.frame -side right -fill both -expand yes

................................................................................
	.downloadprogress.frame.bar start
	update

	ttk::button .downloadprogress.frame.b -text "Cancel" -command {destroy .updateprogress}
	pack .downloadprogress.frame.b -side right -fill both -expand no

	wm geometry .downloadprogress 400x100
	wm resizable .downloadprogress 0 0
	
    }

    #download and install the update
    proc installUpdate {} {
	variable currentinstall
	variable status
	variable appname
	variable tmpdir

	catch {destroy .update}

	softwareupdate::findCurrentInstallation

	softwareupdate::progressDialog
	set status "Downloading update for $appname"
	
	switch [tk windowingsystem] {


	    "aqua" {
		http::geturl http://www.codebykevin.com/updates/[list $appname].tgz -channel [open $tmpdir/[list $appname].tgz w] 
		update
		after 1000
		cd $tmpdir
		set status "Unpacking update for $appname"
		update
		after 1000
		catch {exec tar xvfz [list $appname].tgz}
	    }
	    
	    "win32" {
	
	    }
	    
	    "x11" {
		
	    }
	}
	
	
	set status "Ready to install"
	.downloadprogress.frame.bar configure -mode determinate
	.downloadprogress.frame.bar configure -value 100
	.downloadprogress.frame.bar stop
	destroy .downloadprogress.frame.b 
	pack [ttk::button .downloadprogress.frame.b -text "Install and Relaunch" -command softwareupdate::launchUpdate] -side right -fill both -expand no
	return
    }


    #launch the update
    proc launchUpdate {}  {

	variable currentinstall
	variable appname
	variable tmpdir
	

	switch [tk windowingsystem] {

	    "aqua" {
		if {[catch {exec codesign -v $tmpdir/$appname.app} msg]} {
		    bgerror $msg
		    tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later."
		    return
		} else {

		    file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]]

		    file rename -force $tmpdir/$appname.app $currentinstall

		    exec $currentinstall/Contents/MacOS/$appname &

		    exit
		}
	    }
	    
	    "win32" {
		
	    }
	    
	}

	catch {destroy .downloadprogress}

	

    }



    namespace export *

}