filemorph

Check-in [3ef6454d8b]
Login

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

Overview
Comment:Update for Windows
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3ef6454d8b3015796cc129c06e5992ee146030cb
User & Date: kevin 2018-08-20 19:12:05
Context
2018-08-21
00:41
Refinements for scripting and unit testing on Windows check-in: 27d8264cf3 user: kevin tags: trunk
2018-08-20
19:12
Update for Windows check-in: 3ef6454d8b user: kevin tags: trunk
17:57
Unit test, rev bump for 3.0 and Windows check-in: 6c7f57f091 user: kevin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to filemorph-changes.tcl.

     1         -* Improved scrolling performance, security support on macOS.
     2         -* Improved security support on Windows.
            1  +* New scripting API for Windows.
            2  +* Removal of console on Windows.
            3  +* Migration to new source code server.
            4  +* UI improvements.

Changes to filemorph-version.tcl.

     1         -2.9
            1  +3.0

Changes to filemorph.pl.

    59     59   Tkx::package_require('xplat');
    60     60   
    61     61   if ($IS_AQUA) {
    62     62       Tkx::package_require('fullscreen');
    63     63       Tkx::package_require('aem');
    64     64       Tkx::package_require('cocoaprint');
    65     65       Tkx::package_require('windowlist');
    66         -  }
           66  +}
    67     67   
    68     68   if ($IS_WINDOWS) {
    69         -  Tkx::package_require('dde');
    70         -  Tkx::dde_servername('FileMorph');
           69  +    Tkx::package_require('dde');
           70  +    Tkx::dde_servername('FileMorph');
    71     71   }
    72         -  
    73         -
    74         -  
    75     72   
    76     73   #initialize variables
    77     74   our $folder;
    78     75   our $sourceext;
    79     76   our $targetext;
    80     77   our $targetstring;
    81     78   our $srcstring;
................................................................................
  1083   1080       &Tkx::machelp__userhelp;
  1084   1081   }
  1085   1082   
  1086   1083   #initialize the app
  1087   1084   sub startUp {
  1088   1085   
  1089   1086       $appname    = 'FileMorph';
  1090         -    $appversion = '2.9';
         1087  +    $appversion = '3.0';
  1091   1088       &Tkx::machelp__setAppName( $appname, $appversion );
  1092   1089       &Tkx::softwareupdate__setAppName($appname);
  1093   1090       &Tkx::softwareupdate__setVersion( $appname, $appversion );
  1094   1091   
  1095   1092       #check for app support directory
  1096   1093       our $prefdir = Tkx::xplat__appconfig("FileMorph");
  1097   1094       mkdir $prefdir unless ( -d $prefdir );

Changes to scriptlibs/softwareupdate/softwareupdate.tcl.

    61     61   	variable currentversion
    62     62   	variable versionnumber
    63     63   
    64     64   	set appname $app
    65     65   
    66     66   	softwareupdate::checkingForUpdates
    67     67   
    68         -	set versionurl https://www.codebykevin.com/$appname-version.tcl
           68  +	set versionurl [string tolower https://www.codebykevin.com/$appname-version.tcl]
    69     69   	http::config -useragent "$appname Update Check"
    70     70   
    71     71   	if [catch {http::geturl $versionurl} msg] {
    72         -	    puts "error: $msg"
           72  +	    if {[tk windowingsystem] ne "win32"} { puts "error: $msg"}
    73     73   	    tk_messageBox -icon warning -title "Unable to Connect to Server" -message "Unable to Connect to Server" -detail "Unable to connect to www.codebykevin.com to check for updates. Please make sure you are connected to the Internet." -parent .
    74     74   	catch {destroy .updateprogress}
    75     75   	    return
    76     76   	} 
    77     77   
    78     78   	set versionnumber [string trim [http::data [http::geturl $versionurl]]]
    79     79   	if [expr $currentversion < $versionnumber] {
................................................................................
   130    130   
   131    131   	catch {destroy .updateprogress}
   132    132   
   133    133   	catch {destroy .update}
   134    134   	
   135    135   	variable appname
   136    136   
   137         -	set changeurl https://www.codebykevin.com/$appname-changes.tcl
          137  +	set changeurl [string tolower https://www.codebykevin.com/$appname-changes.tcl]
   138    138   
   139    139           if [catch {http::geturl $changeurl} msg] {
   140         -	    puts "error: $msg"
          140  +	    if {[tk windowingsystem] ne "win32"} { puts "error: $msg"}
   141    141   	    tk_messageBox -icon warning -title "Unable to Connect to Server" -message "Unable to Connect to Server" -detail "Unable to connect to www.codebykevin.com to check for updates. Please make sure you are connected to the Internet." -parent .
   142    142   	    catch {destroy .updateprogress}
   143    143   	    return
   144    144   	} 
   145    145   
   146    146   
   147    147   	set changelist [http::data [http::geturl $changeurl]]
................................................................................
   272    272   
   273    273   	softwareupdate::progressDialog
   274    274   	set status "Downloading update for $appname"
   275    275   	
   276    276   	switch [tk windowingsystem] {
   277    277   
   278    278   	    "aqua" {
   279         -		http::geturl https://www.codebykevin.com/updates/[list $appname].dmg -channel [open $tmpdir/[list $appname].dmg w] 
          279  +		update
          280  +		after 1000
          281  +		#http package causes file corruption of the DMG for some reason
          282  +		exec curl -s https://www.codebykevin.com/updates/[list $appname].dmg -o  $tmpdir/[list $appname].dmg
   280    283   		update
   281    284   		after 1000
   282    285   		cd $tmpdir
   283    286   		set status "Attaching [list $appname].dmg"
   284    287   		update
   285    288   		exec hdiutil attach [list $appname].dmg
   286    289   	    }
   287    290   	    
   288    291   	    "win32" {
   289    292   		
   290         -		http::geturl https://www.codebykevin.com/updates/[list $appname]_Setup.exe -channel [open $tmpdir/[list $appname]_Setup.exe w]
          293  +		http::geturl https://www.codebykevin.com/updates/[list $appname]_Setup.exe -binary 1 -channel [open $tmpdir/[list $appname]_Setup.exe wb]
   291    294   
   292    295   	    }
   293    296   	    
   294    297   	    "x11" {
   295    298   		tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
   296    299   		return
   297    300   	    }