Anyone else needing this U2 updater?

  • From: "Harry Binswanger" <hb@xxxxxxxxxxxx>
  • To: <xywrite@xxxxxxxxxxxxx>
  • Date: Sat, 31 Dec 2016 00:02:17 -0500

I may be the only one who writes his own, supplementary, U2
frames. If so, then no one needs the program I wrote to preserve
those when updating U2.
 
But here it is, if anyone out there in Xy-land wants it. It's
written as a U2 frame itself, and it does a ton of error-checking,
so, with a goodly amount of commenting.
It presumes that:
 
1. you have downloaded the new U2 and have unzipped its files into
a subdirectory of the directory that the current U2 is in. The
subdirectory must be named "newu2dir".
 
2. you have placed all your personal frames in one section of the
U2, delimited by MyFramesStart and MyFramesEnd-each must be on a
line by themselves, like this:
MyFramesStart
...
....
....
MyFramesEnd
...
 
It places your frames at the top of the new U2, which is a bit
risky, since placing them there means they take precedence over
any other frames with the identical name. You can always move them
manually to the bottom of the U2 file after the program has run.
 
Carl, maybe you want to include this in the "stock" U2.
The below is encoded with frame XyEnc and should be decoded by
using XyDec.
 
'%--_XYENCode_start--
{{5updateU2}}_HB--December_30,_2016._For_updating_XyWWWeb.u2_w
hen_user-written_frames_are_to_be_transferred_from_the_existin
g_U2_to_to_the_new_one._Assumes_that_the_zip_file_has_been_ext
racted_to_a_directory_off_the_current_U2'`s_directory,_and_ass
umes_that_all_the_user-written_frames_are_in_one_section_of_th
e_old_U2,_delimited_by_MyFramesStart_(case-insenstive)_and_MyF
ramesEnd--where_each_is_on_a_line_by_itself--i.e._each_must_be
_surrounded_by_[CrLf]s.'^~B~<SX01,~<VA$U2~>~>~<SX01,~<IS01~>~>
',*',_I_don'`t_know_why_01_has_to_be_re-stored'^~<SV02,\~>~<XS
01,02,03,04,05~>',*','^~<IF~<IS05~><>"XYWWWEB.U2"~>',*','^'BCT
his_updates_XYWWWEB.U2,_but_~<PV05~>_is_loaded--continue?_[n]o
,_e[x]it',*','^~<SX05,~<RK~>~>~<IF~<IS05~>=="n"'|~<IS05~>=="x"
~>'BC~<PRAborting~>~<EX1~>~<EI~>~<EI~>',*','^~<SX03,~<IS03~>+~<
IS02~>~>',*',_03_now_has,_e.g.,_c'.\Xy4\'^~<SX05,~<IS03~>+"new
u2dir\"~>',*',_05_is,_e.g.,_c'.\Xy4\newu2dir\'^'BXexist_~<PV03
~>XYWWWEB.U2'Q2',*','^~<IF~<ER~>~>'BC~<PR_can'`t_find_XYWWWEB.
U2_in_@03~>~<EX~>~<EI~>',*',_no_dir_or_no_file'^'BXgofile_~<PV
03~>new.u2'Q2~<IF@NOT(~<ER~>)~>'BXab/nv'Q2~<EI~>',*',_close_if
_open'^'BXgofile_~<PV03~>old.u2'Q2~<IF@NOT(~<ER~>)~>'BXab/nv'Q2
~<EI~>',*',_close_if_open'^'BXcopy/nv_~<PV03~>xywwweb.u2_~<PV0
3~>old.u2'Q2',*',_will_get_"myframes"_from_old.u2'^~<IF~<ER~>~>
'BCCan'`t_copy_~<PV03~>xywwweb.u2_to_~<PV03~>old.u2~<EX1~>~<EI
~>',*',_'^'BXexist_~<PV03~>old.u2'Q2',*',_a_double_check'^~<IF
~<ER~>~>'BCCan'`t_find_~<PV03~>OLD.U2~<EX~>~<EI~>',*','^'BXcop
y/nv_~<PV05~>xywwweb.u2_~<PV03~>new.u2'Q2',*','^~<IF~<ER~>~>'BC
Can'`t_copy_~<PV05~>XYWWWEB.U2_to_~<PV03~>NEW.U2~<EX1~>~<EI~>',
*','^',*',_double_check_follows'^'BXexist_~<PV03~>new.u2'Q2',*
','^~<IF~<ER~>~>'BCCan'`t_copy_~<PV03~>XYWWWEB.U2_to_~<PV03~>N
EW.U2~<EX~>~<EI~>',*','^'BXca/100_~<PV03~>old.U2'Q2',*','^~<IF
~<ER~>~>~<'BCCan'`t_open_~<PV03~>OLD.U2~<EX1~>~<EI~>',*','^'TF
'BXse/f_/;~[MyFramesStart;~[/'Q2',*','^~<IF~<ER~>~>'BCCan'`t_f
ind_'`;~[MyFramesStart;~[~<EX1~>~<EI~>',*','^'XD'DF',*','^'BXs
e_/;~[MyFramesEnd;~[/'Q2',*','^~<IF~<ER~>~>'BCCan'`t_find_;~[M
yFramesEnd;~[~<EX1~>~<EI~>',*','^'DF',*','^'BXsad/nv_~<PV03~>m
yframes.u2'Q2',*','^~<IF~<ER~>~>'BCCan'`t_sad/nv_~<PV03~>MYFRA
MES.U2~<EX1~>~<EI~>',*','^'RD'BXab'Q2',*',_close_old.u2'^'BXca
/100_~<PV03~>new.u2'Q2~<IF~<ER~>~>'BCcan'`t_open_~<PV03~>NEW.U
2~<EX1~>~<EI~>',*','^'TF'BXse_/;~[MyFramesStart;~[/'Q2',*','^~<
IF@NOT(~<ER~>)~>'BCThere_already_is_a_;~[MyFramesStart;~[_in_~<
PV03~>NEW.U2~>~<EX1~>~<EI~>',*','^'TF'BXse/f_/{/'Q2~<IF~<ER~>~>
'BCcan'`t_find_{~<EX1~>~<EI~>',*','^'DF'RD:~M:~M'CU'CU',*','^'BX
me_~<PV03~>myframes.u2'Q2~<IF~<ER~>~>'BCCan'`t_merge_in_~<PV03
~>MYFRAMES.U2~<EX~>~<EI~>',*','^'BXsa/nv_~<PV03~>xywwweb.u2'Q2
~<IF~<ER~>~>'BCCan'`t_save_~<PV03~>xywwweb.u2~<EX~>~<EI~>',*',
'^'JM2.lh_'Q2'TF'BCNew_xywwweb.u2_should_be_loaded_(old_one_is
_~<PV03~>OLD.U2,_in_case_you_need_it)~<EX~>'^
'%--_XYENCode___end--

Other related posts: