diff --git a/.gitignore b/.gitignore index 1c193dc..6c8b391 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ Kaju Admin App/Builds - Kaju Admin.xojo_project Kaju Admin CLI/kaju.debug Kaju Admin CLI/Builds - Kaju Admin CLI.xojo_project *.gz +Update Test App/Builds - Kaju Update Test +Kaju Admin App/Builds - Kaju Admin +Kaju Admin CLI/Builds - Kaju Admin CLI diff --git a/Admin Classes/KajuFile.xojo_code b/Admin Classes/KajuFile.xojo_code index d3dcb63..b36edf8 100644 --- a/Admin Classes/KajuFile.xojo_code +++ b/Admin Classes/KajuFile.xojo_code @@ -27,7 +27,7 @@ Protected Class KajuFile data.EscapeSlashes = false // - // Perform $VERSION$ substitutions + // Perform $VERSION$ substitutions and add security token // dim keys() as string = Kaju.UpdateInformation.BinaryNames @@ -97,7 +97,7 @@ Protected Class KajuFile #tag EndMethod #tag Method, Flags = &h0 - Shared Function InsertVersion(originalURL As String, version As String) As String + Shared Function InsertVersion(originalURL As String, version As String) As String return originalURL.ReplaceAllB( "$VERSION$", version ) End Function #tag EndMethod @@ -261,6 +261,7 @@ Protected Class KajuFile Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -268,18 +269,23 @@ Protected Class KajuFile Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -287,6 +293,7 @@ Protected Class KajuFile Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Custom Plist/Info.plist b/Custom Plist/Info.plist new file mode 100644 index 0000000..6a6654d --- /dev/null +++ b/Custom Plist/Info.plist @@ -0,0 +1,11 @@ + + + + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + + diff --git a/External Images/Some_Image.png b/External Images/Some_Image.png deleted file mode 100644 index 5ca3db5..0000000 Binary files a/External Images/Some_Image.png and /dev/null differ diff --git a/External Images/plush-bears-beta@2x.png b/External Images/plush-bears-beta@2x.png new file mode 100644 index 0000000..94f4a90 Binary files /dev/null and b/External Images/plush-bears-beta@2x.png differ diff --git a/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@1x.png b/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@1x.png new file mode 100644 index 0000000..f2f7c52 Binary files /dev/null and b/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@1x.png differ diff --git a/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@2x.png b/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@2x.png new file mode 100644 index 0000000..4df460b Binary files /dev/null and b/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@2x.png differ diff --git a/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@3x.png b/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@3x.png new file mode 100644 index 0000000..4d4ea61 Binary files /dev/null and b/External Images/plush-bears-vector-clipart-from-goodfreephotos-com@3x.png differ diff --git a/Kaju Admin App/Controls/BinaryInformationControl.xojo_window b/Kaju Admin App/Controls/BinaryInformationControl.xojo_window index 028ec84..391d066 100644 --- a/Kaju Admin App/Controls/BinaryInformationControl.xojo_window +++ b/Kaju Admin App/Controls/BinaryInformationControl.xojo_window @@ -5,7 +5,7 @@ Begin ContainerControl BinaryInformationControl AutoDeactivate = True BackColor = &cFFFFFF00 Backdrop = 0 - Compatibility = "" + DoubleBuffer = False Enabled = True EraseBackground = True HasBackColor = False @@ -28,7 +28,7 @@ Begin ContainerControl BinaryInformationControl Begin PushButton btnHashFromURL AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = False Caption = "From URL" Default = False @@ -52,6 +52,7 @@ Begin ContainerControl BinaryInformationControl TextSize = 0.0 TextUnit = 0 Top = 66 + Transparent = False Underline = False Visible = False Width = 80 @@ -83,6 +84,7 @@ Begin ContainerControl BinaryInformationControl TextSize = 0.0 TextUnit = 0 Top = 0 + Transparent = False Underline = False Value = False Visible = True @@ -125,6 +127,7 @@ Begin ContainerControl BinaryInformationControl TextSize = 0.0 TextUnit = 0 Top = 66 + Transparent = False Underline = False UseFocusRing = True Visible = False @@ -167,6 +170,7 @@ Begin ContainerControl BinaryInformationControl TextSize = 0.0 TextUnit = 0 Top = 100 + Transparent = False Underline = False UseFocusRing = True Visible = False @@ -194,6 +198,7 @@ Begin ContainerControl BinaryInformationControl Selectable = False TabIndex = 4 TabPanelIndex = 0 + TabStop = True Text = "Hash:" TextAlign = 0 TextColor = &c00000000 @@ -204,7 +209,7 @@ Begin ContainerControl BinaryInformationControl Transparent = False Underline = False Visible = False - Width = 67 + Width = 97 End Begin Label lblURL AutoDeactivate = True @@ -228,6 +233,7 @@ Begin ContainerControl BinaryInformationControl Selectable = False TabIndex = 5 TabPanelIndex = 0 + TabStop = True Text = "URL:" TextAlign = 0 TextColor = &c00000000 @@ -238,7 +244,7 @@ Begin ContainerControl BinaryInformationControl Transparent = False Underline = False Visible = False - Width = 67 + Width = 97 End Begin TextFieldChanger fldExecutable AcceptTabs = False @@ -277,6 +283,7 @@ Begin ContainerControl BinaryInformationControl TextSize = 0.0 TextUnit = 0 Top = 32 + Transparent = False Underline = False UseFocusRing = True Visible = False @@ -304,6 +311,7 @@ Begin ContainerControl BinaryInformationControl Selectable = False TabIndex = 7 TabPanelIndex = 0 + TabStop = True Text = "Executable:" TextAlign = 0 TextColor = &c00000000 @@ -311,10 +319,10 @@ Begin ContainerControl BinaryInformationControl TextSize = 0.0 TextUnit = 0 Top = 33 - Transparent = False + Transparent = True Underline = False Visible = False - Width = 67 + Width = 97 End End #tag EndWindow @@ -420,14 +428,13 @@ End hashField.Text = "" - dim http as new Kaju.HTTPSSocket - url = http.GetRedirectAddress( url, 5 ) + dim http as new Kaju.HTTPSocketAsync dim file as FolderItem = GetTemporaryFolderItem - dim r as boolean = http.Get( url, file, 30 ) - if not r or http.LastErrorCode <> 0 then + http.GetSync( url, file, 30 ) + if http.HTTPStatusCode <> 200 then - MsgBox "Could not get the executable from that url: " + str( http.LastErrorCode ) + MsgBox "Could not get the executable from that url: " + str( http.HTTPStatusCode ) else @@ -551,46 +558,82 @@ End #tag EndEvents #tag ViewBehavior #tag ViewProperty - Name="AcceptFocus" + Name="AllowAutoDeactivate" Visible=true - Group="Behavior" - InitialValue="False" + Group="Appearance" + InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="AcceptTabs" + Name="Tooltip" Visible=true - Group="Behavior" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" + Group="Appearance" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty - Name="AutoDeactivate" + Name="AllowFocusRing" Visible=true Group="Appearance" - InitialValue="True" + InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="BackColor" + Name="BackgroundColor" Visible=true Group="Background" InitialValue="&hFFFFFF" Type="Color" + EditorType="Color" + #tag EndViewProperty + #tag ViewProperty + Name="HasBackgroundColor" + Visible=true + Group="Background" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="AllowFocus" + Visible=true + Group="Behavior" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="AllowTabs" + Visible=true + Group="Behavior" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="DoubleBuffer" + Visible=true + Group="Windows Behavior" + InitialValue="False" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Backdrop" Visible=true Group="Background" + InitialValue="" Type="Picture" - EditorType="Picture" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="BinaryName" Visible=true Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -600,7 +643,7 @@ End Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="EraseBackground" @@ -608,14 +651,7 @@ End Group="Behavior" InitialValue="True" Type="Boolean" - EditorType="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="HasBackColor" - Visible=true - Group="Background" - InitialValue="False" - Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Height" @@ -623,66 +659,79 @@ End Group="Size" InitialValue="300" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="HelpTag" - Visible=true - Group="Appearance" - Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="InitialParent" + Visible=false Group="Position" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="IsChecked" + Visible=false Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockBottom" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockLeft" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockRight" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockTop" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabIndex" @@ -690,12 +739,15 @@ End Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabPanelIndex" + Visible=false Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabStop" @@ -703,13 +755,15 @@ End Group="Position" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Transparent" @@ -717,15 +771,7 @@ End Group="Behavior" InitialValue="True" Type="Boolean" - EditorType="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="UseFocusRing" - Visible=true - Group="Appearance" - InitialValue="False" - Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Visible" @@ -733,7 +779,7 @@ End Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Width" @@ -741,5 +787,6 @@ End Group="Size" InitialValue="300" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior diff --git a/Kaju Admin App/Controls/CheckBoxChanger.xojo_code b/Kaju Admin App/Controls/CheckBoxChanger.xojo_code index 1de8168..8a05e74 100644 --- a/Kaju Admin App/Controls/CheckBoxChanger.xojo_code +++ b/Kaju Admin App/Controls/CheckBoxChanger.xojo_code @@ -16,17 +16,80 @@ Inherits CheckBox #tag ViewBehavior #tag ViewProperty - Name="AutoDeactivate" + Name="AllowAutoDeactivate" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Tooltip" + Visible=true + Group="Appearance" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="FontName" + Visible=true + Group="Font" + InitialValue="System" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontSize" + Visible=true + Group="Font" + InitialValue="0" + Type="Single" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontUnit" + Visible=true + Group="Font" + InitialValue="0" + Type="FontUnits" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Pixel" + "2 - Point" + "3 - Inch" + "4 - Millimeter" + #tag EndEnumValues + #tag EndViewProperty + #tag ViewProperty + Name="VisualState" + Visible=true + Group="Initial State" + InitialValue="0" + Type="VisualStates" + EditorType="Enum" + #tag EnumValues + "0 - Unchecked" + "1 - Checked" + "2 - Indeterminate" + #tag EndEnumValues + #tag EndViewProperty + #tag ViewProperty + Name="Transparent" + Visible=true + Group="Appearance" + InitialValue="False" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Bold" Visible=true Group="Font" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Caption" @@ -34,11 +97,13 @@ Inherits CheckBox Group="Appearance" InitialValue="Untitled" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="DataField" Visible=true Group="Database Binding" + InitialValue="" Type="String" EditorType="DataField" #tag EndViewProperty @@ -46,6 +111,7 @@ Inherits CheckBox Name="DataSource" Visible=true Group="Database Binding" + InitialValue="" Type="String" EditorType="DataSource" #tag EndViewProperty @@ -55,6 +121,7 @@ Inherits CheckBox Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Height" @@ -62,87 +129,87 @@ Inherits CheckBox Group="Position" InitialValue="20" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="HelpTag" - Visible=true - Group="Appearance" - Type="String" - EditorType="MultiLineEditor" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" + InitialValue="" Type="Integer" - EditorType="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="InitialParent" + Visible=false + Group="" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Italic" Visible=true Group="Font" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockBottom" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockLeft" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockRight" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockTop" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" - #tag EndViewProperty - #tag ViewProperty - Name="State" - Visible=true - Group="Initial State" - InitialValue="0" - Type="CheckedStates" - EditorType="Enum" - #tag EnumValues - "0 - Unchecked" - "1 - Checked" - "2 - Indeterminate" - #tag EndEnumValues + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabIndex" @@ -150,12 +217,15 @@ Inherits CheckBox Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabPanelIndex" + Visible=false Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabStop" @@ -163,53 +233,31 @@ Inherits CheckBox Group="Position" InitialValue="True" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="TextFont" - Visible=true - Group="Font" - InitialValue="System" - Type="String" - #tag EndViewProperty - #tag ViewProperty - Name="TextSize" - Visible=true - Group="Font" - InitialValue="0" - Type="Single" - #tag EndViewProperty - #tag ViewProperty - Name="TextUnit" - Visible=true - Group="Font" - InitialValue="0" - Type="FontUnits" - EditorType="Enum" - #tag EnumValues - "0 - Default" - "1 - Pixel" - "2 - Point" - "3 - Inch" - "4 - Millimeter" - #tag EndEnumValues + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Underline" Visible=true Group="Font" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Value" + Visible=false Group="Initial State" InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Visible" @@ -217,6 +265,7 @@ Inherits CheckBox Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Width" @@ -224,6 +273,7 @@ Inherits CheckBox Group="Position" InitialValue="100" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Admin App/Controls/PopupMenuChanger.xojo_code b/Kaju Admin App/Controls/PopupMenuChanger.xojo_code new file mode 100644 index 0000000..181ee81 --- /dev/null +++ b/Kaju Admin App/Controls/PopupMenuChanger.xojo_code @@ -0,0 +1,268 @@ +#tag Class +Protected Class PopupMenuChanger +Inherits PopupMenu + #tag Event + Sub Change() + self.TrueWindow.ContentsChanged = true + RaiseEvent Change() + + End Sub + #tag EndEvent + + + #tag Hook, Flags = &h0 + Event Change() + #tag EndHook + + + #tag ViewBehavior + #tag ViewProperty + Name="AllowAutoDeactivate" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Tooltip" + Visible=true + Group="Appearance" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="SelectedRowIndex" + Visible=true + Group="Appearance" + InitialValue="0" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontName" + Visible=true + Group="Font" + InitialValue="System" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontSize" + Visible=true + Group="Font" + InitialValue="0" + Type="Single" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontUnit" + Visible=true + Group="Font" + InitialValue="0" + Type="FontUnits" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Pixel" + "2 - Point" + "3 - Inch" + "4 - Millimeter" + #tag EndEnumValues + #tag EndViewProperty + #tag ViewProperty + Name="Name" + Visible=true + Group="ID" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Index" + Visible=true + Group="ID" + InitialValue="" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Super" + Visible=true + Group="ID" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Left" + Visible=true + Group="Position" + InitialValue="" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Top" + Visible=true + Group="Position" + InitialValue="" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Width" + Visible=true + Group="Position" + InitialValue="80" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Height" + Visible=true + Group="Position" + InitialValue="20" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="LockLeft" + Visible=true + Group="Position" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="LockTop" + Visible=true + Group="Position" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="LockRight" + Visible=true + Group="Position" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="LockBottom" + Visible=true + Group="Position" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="TabPanelIndex" + Visible=false + Group="Position" + InitialValue="0" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="TabIndex" + Visible=true + Group="Position" + InitialValue="0" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="TabStop" + Visible=true + Group="Position" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Enabled" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="InitialValue" + Visible=true + Group="Appearance" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="Visible" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Transparent" + Visible=true + Group="Appearance" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Bold" + Visible=true + Group="Font" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Italic" + Visible=true + Group="Font" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Underline" + Visible=true + Group="Font" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="DataSource" + Visible=true + Group="Database Binding" + InitialValue="" + Type="String" + EditorType="DataSource" + #tag EndViewProperty + #tag ViewProperty + Name="DataField" + Visible=true + Group="Database Binding" + InitialValue="" + Type="String" + EditorType="DataField" + #tag EndViewProperty + #tag ViewProperty + Name="InitialParent" + Visible=false + Group="" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag EndViewBehavior +End Class +#tag EndClass diff --git a/Kaju Admin App/Controls/TextAreaChanger.xojo_code b/Kaju Admin App/Controls/TextAreaChanger.xojo_code index e2d7c70..b9592ad 100644 --- a/Kaju Admin App/Controls/TextAreaChanger.xojo_code +++ b/Kaju Admin App/Controls/TextAreaChanger.xojo_code @@ -16,17 +16,130 @@ Inherits TextArea #tag ViewBehavior #tag ViewProperty - Name="AcceptTabs" + Name="AllowAutoDeactivate" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="BackgroundColor" + Visible=true + Group="Appearance" + InitialValue="&hFFFFFF" + Type="Color" + EditorType="Color" + #tag EndViewProperty + #tag ViewProperty + Name="HasBorder" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Tooltip" + Visible=true + Group="Appearance" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="HasHorizontalScrollbar" + Visible=true + Group="Appearance" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="HasVerticalScrollbar" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="AllowStyledText" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Transparent" + Visible=true + Group="Appearance" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="AllowFocusRing" + Visible=true + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontName" + Visible=true + Group="Font" + InitialValue="System" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontSize" + Visible=true + Group="Font" + InitialValue="0" + Type="Single" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontUnit" + Visible=true + Group="Font" + InitialValue="0" + Type="FontUnits" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Pixel" + "2 - Point" + "3 - Inch" + "4 - Millimeter" + #tag EndEnumValues + #tag EndViewProperty + #tag ViewProperty + Name="Value" + Visible=true + Group="Initial State" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="AllowTabs" Visible=true Group="Behavior" + InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Alignment" + Name="TextAlignment" Visible=true Group="Behavior" InitialValue="0" - Type="Integer" + Type="TextAlignments" EditorType="Enum" #tag EnumValues "0 - Default" @@ -36,43 +149,42 @@ Inherits TextArea #tag EndEnumValues #tag EndViewProperty #tag ViewProperty - Name="AutoDeactivate" + Name="AllowSpellChecking" Visible=true - Group="Appearance" + Group="Behavior" InitialValue="True" - Type="Boolean" + Type="boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="AutomaticallyCheckSpelling" + Name="MaximumCharactersAllowed" Visible=true Group="Behavior" - InitialValue="True" - Type="boolean" + InitialValue="0" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="BackColor" + Name="ValidationMask" Visible=true - Group="Appearance" - InitialValue="&hFFFFFF" - Type="Color" + Group="Behavior" + InitialValue="" + Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Bold" Visible=true Group="Font" + InitialValue="" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="Border" - Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="DataField" Visible=true Group="Database Binding" + InitialValue="" Type="String" EditorType="DataField" #tag EndViewProperty @@ -80,6 +192,7 @@ Inherits TextArea Name="DataSource" Visible=true Group="Database Binding" + InitialValue="" Type="String" EditorType="DataSource" #tag EndViewProperty @@ -89,12 +202,15 @@ Inherits TextArea Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Format" Visible=true Group="Appearance" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Height" @@ -102,13 +218,7 @@ Inherits TextArea Group="Position" InitialValue="100" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="HelpTag" - Visible=true - Group="Appearance" - Type="String" - EditorType="MultiLineEditor" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="HideSelection" @@ -116,32 +226,31 @@ Inherits TextArea Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" + InitialValue="" Type="Integer" - EditorType="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Italic" Visible=true Group="Font" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" + InitialValue="" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="LimitText" - Visible=true - Group="Behavior" - InitialValue="0" - Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LineHeight" @@ -149,6 +258,7 @@ Inherits TextArea Group="Appearance" InitialValue="0" Type="Double" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LineSpacing" @@ -156,36 +266,39 @@ Inherits TextArea Group="Appearance" InitialValue="1" Type="Double" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockBottom" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockLeft" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockRight" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockTop" Visible=true Group="Position" + InitialValue="" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="Mask" - Visible=true - Group="Behavior" - Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Multiline" @@ -193,46 +306,31 @@ Inherits TextArea Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="ReadOnly" Visible=true Group="Behavior" + InitialValue="" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="ScrollbarHorizontal" - Visible=true - Group="Appearance" - Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="ScrollbarVertical" - Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="Styled" - Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabIndex" @@ -240,12 +338,15 @@ Inherits TextArea Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabPanelIndex" + Visible=false Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabStop" @@ -253,13 +354,7 @@ Inherits TextArea Group="Position" InitialValue="True" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="Text" - Visible=true - Group="Initial State" - Type="String" - EditorType="MultiLineEditor" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TextColor" @@ -267,54 +362,23 @@ Inherits TextArea Group="Appearance" InitialValue="&h000000" Type="Color" - #tag EndViewProperty - #tag ViewProperty - Name="TextFont" - Visible=true - Group="Font" - InitialValue="System" - Type="String" - #tag EndViewProperty - #tag ViewProperty - Name="TextSize" - Visible=true - Group="Font" - InitialValue="0" - Type="Single" - #tag EndViewProperty - #tag ViewProperty - Name="TextUnit" - Visible=true - Group="Font" - InitialValue="0" - Type="FontUnits" - EditorType="Enum" - #tag EnumValues - "0 - Default" - "1 - Pixel" - "2 - Point" - "3 - Inch" - "4 - Millimeter" - #tag EndEnumValues + EditorType="Color" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Underline" Visible=true Group="Font" + InitialValue="" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="UseFocusRing" - Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Visible" @@ -322,6 +386,7 @@ Inherits TextArea Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Width" @@ -329,6 +394,7 @@ Inherits TextArea Group="Position" InitialValue="100" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Admin App/Controls/TextFieldChanger.xojo_code b/Kaju Admin App/Controls/TextFieldChanger.xojo_code index 217ac83..8c603cd 100644 --- a/Kaju Admin App/Controls/TextFieldChanger.xojo_code +++ b/Kaju Admin App/Controls/TextFieldChanger.xojo_code @@ -16,70 +16,159 @@ Inherits TextField #tag ViewBehavior #tag ViewProperty - Name="AcceptTabs" + Name="AllowAutoDeactivate" Visible=true - Group="Behavior" + Group="Appearance" + InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Alignment" + Name="BackgroundColor" Visible=true - Group="Behavior" - InitialValue="0" - Type="Integer" - EditorType="Enum" - #tag EnumValues - "0 - Default" - "1 - Left" - "2 - Center" - "3 - Right" - #tag EndEnumValues + Group="Appearance" + InitialValue="&hFFFFFF" + Type="Color" + EditorType="Color" #tag EndViewProperty #tag ViewProperty - Name="AutoDeactivate" + Name="HasBorder" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="AutomaticallyCheckSpelling" + Name="Tooltip" Visible=true - Group="Behavior" + Group="Appearance" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="Transparent" + Visible=true + Group="Appearance" InitialValue="False" - Type="boolean" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="BackColor" + Name="AllowFocusRing" Visible=true Group="Appearance" - InitialValue="&hFFFFFF" - Type="Color" + InitialValue="True" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Bold" + Name="FontName" Visible=true Group="Font" - Type="Boolean" + InitialValue="System" + Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Border" + Name="FontSize" Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" + Group="Font" + InitialValue="0" + Type="Single" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FontUnit" + Visible=true + Group="Font" + InitialValue="0" + Type="FontUnits" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Pixel" + "2 - Point" + "3 - Inch" + "4 - Millimeter" + #tag EndEnumValues #tag EndViewProperty #tag ViewProperty - Name="CueText" + Name="Hint" Visible=true Group="Initial State" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty + #tag ViewProperty + Name="Value" + Visible=true + Group="Initial State" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="AllowTabs" + Visible=true + Group="Behavior" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="TextAlignment" + Visible=true + Group="Behavior" + InitialValue="0" + Type="TextAlignments" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Left" + "2 - Center" + "3 - Right" + #tag EndEnumValues + #tag EndViewProperty + #tag ViewProperty + Name="AllowSpellChecking" + Visible=true + Group="Behavior" + InitialValue="False" + Type="boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="MaximumCharactersAllowed" + Visible=true + Group="Behavior" + InitialValue="0" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="ValidationMask" + Visible=true + Group="Behavior" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Bold" + Visible=true + Group="Font" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty #tag ViewProperty Name="DataField" Visible=true Group="Database Binding" + InitialValue="" Type="String" EditorType="DataField" #tag EndViewProperty @@ -87,6 +176,7 @@ Inherits TextField Name="DataSource" Visible=true Group="Database Binding" + InitialValue="" Type="String" EditorType="DataSource" #tag EndViewProperty @@ -96,12 +186,15 @@ Inherits TextField Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Format" Visible=true Group="Appearance" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Height" @@ -109,95 +202,95 @@ Inherits TextField Group="Position" InitialValue="22" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="HelpTag" - Visible=true - Group="Appearance" - Type="String" - EditorType="MultiLineEditor" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" + InitialValue="" Type="Integer" - EditorType="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Italic" Visible=true Group="Font" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" + InitialValue="" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="LimitText" - Visible=true - Group="Behavior" - InitialValue="0" - Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockBottom" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockLeft" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockRight" Visible=true Group="Position" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="LockTop" Visible=true Group="Position" + InitialValue="" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="Mask" - Visible=true - Group="Behavior" - Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Password" Visible=true Group="Appearance" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="ReadOnly" Visible=true Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabIndex" @@ -205,12 +298,15 @@ Inherits TextField Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabPanelIndex" + Visible=false Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TabStop" @@ -218,13 +314,7 @@ Inherits TextField Group="Position" InitialValue="True" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="Text" - Visible=true - Group="Initial State" - Type="String" - EditorType="MultiLineEditor" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TextColor" @@ -232,54 +322,23 @@ Inherits TextField Group="Appearance" InitialValue="&h000000" Type="Color" - #tag EndViewProperty - #tag ViewProperty - Name="TextFont" - Visible=true - Group="Font" - InitialValue="System" - Type="String" - #tag EndViewProperty - #tag ViewProperty - Name="TextSize" - Visible=true - Group="Font" - InitialValue="0" - Type="Single" - #tag EndViewProperty - #tag ViewProperty - Name="TextUnit" - Visible=true - Group="Font" - InitialValue="0" - Type="FontUnits" - EditorType="Enum" - #tag EnumValues - "0 - Default" - "1 - Pixel" - "2 - Point" - "3 - Inch" - "4 - Millimeter" - #tag EndEnumValues + EditorType="Color" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Underline" Visible=true Group="Font" + InitialValue="" Type="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="UseFocusRing" - Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Visible" @@ -287,6 +346,7 @@ Inherits TextField Group="Appearance" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Width" @@ -294,6 +354,7 @@ Inherits TextField Group="Position" InitialValue="80" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Admin App/Kaju Admin.xojo_project b/Kaju Admin App/Kaju Admin.xojo_project index e28a020..83d5685 100644 --- a/Kaju Admin App/Kaju Admin.xojo_project +++ b/Kaju Admin App/Kaju Admin.xojo_project @@ -1,40 +1,45 @@ Type=Desktop -RBProjectVersion=2017.011 +RBProjectVersion=2019.031 MinIDEVersion=20070100 -Folder=Kaju Classes;../Kaju Classes;&h2570CF64;&h0;false -Class=App;App.xojo_code;&h7955649;&h0;false -MenuBar=MainMenuBar;MainMenuBar.xojo_menu;&h4AB8FF74;&h0;false -FileTypeSet=FileTypes1;FileTypes1.xojo_filetypeset;&h352FB9F5;&h0;false -Window=WndAdmin;WndAdmin.xojo_window;&h5D541828;&h0;false -BuildSteps=Build Automation;Build Automation.xojo_code;&h378B80A5;&h0;false -Module=Kaju;../Kaju Classes/Kaju.xojo_code;&h11400316;&h2570CF64;false -Module=KajuLocale;../Kaju Classes/KajuLocale.xojo_code;&h20D2554;&h2570CF64;false -Window=KajuUpdateWindow;../Kaju Classes/KajuUpdateWindow.xojo_window;&h18AE3D9;&h2570CF64;false -Class=UpdateChecker;../Kaju Classes/Kaju/UpdateChecker.xojo_code;&h70CF0A50;&h11400316;false -Class=KajuException;../Kaju Classes/Kaju/KajuException.xojo_code;&h3047231F;&h11400316;false -Class=UpdateInformation;../Kaju Classes/Kaju/UpdateInformation.xojo_code;&h79AE1ADC;&h11400316;false -Class=BinaryInformation;../Kaju Classes/Kaju/BinaryInformation.xojo_code;&hE8D70B5;&h11400316;false -Class=ZipShell;../Kaju Classes/Kaju/ZipShell.xojo_code;&hCC15E9B;&h11400316;false -Class=Information;../Kaju Classes/Kaju/Information.xojo_code;&h6497A7C4;&h11400316;false -Class=UpdateInitiater;../Kaju Classes/Kaju/UpdateInitiater.xojo_code;&h4DBB48E5;&h11400316;false -Folder=Controls;Controls;&hE8B14E5;&h0;false -Folder=Other Classes;Other Classes;&h6AF5D169;&h0;false -Class=TextFieldChanger;Controls/TextFieldChanger.xojo_code;&h4D090F7E;&hE8B14E5;false -Class=TextAreaChanger;Controls/TextAreaChanger.xojo_code;&hDD8825B;&hE8B14E5;false -Class=CheckBoxChanger;Controls/CheckBoxChanger.xojo_code;&h5115CD40;&hE8B14E5;false -Class=FolderItemAlias;Other Classes/FolderItemAlias.xojo_code;&h53EF1AE5;&h6AF5D169;false -Class=HTTPSSocket;../Kaju Classes/Kaju/HTTPSSocket.xojo_code;&h5ACDFAEB;&h11400316;false -Class=KajuFile;../Admin Classes/KajuFile.xojo_code;&h1A7FF7FF;&h0;false -Window=BinaryInformationControl;Controls/BinaryInformationControl.xojo_window;&h5D6E5FFF;&hE8B14E5;false +OrigIDEVersion=00000000 +Folder=Kaju Classes;../Kaju Classes;&h000000002570CF64;&h0000000000000000;false +Folder=Custom Plist;../Custom Plist;&h00000000721CD7FF;&h0000000000000000;false +Class=App;App.xojo_code;&h0000000007955649;&h0000000000000000;false +MenuBar=MainMenuBar;MainMenuBar.xojo_menu;&h000000004AB8FF74;&h0000000000000000;false +FileTypeSet=FileTypes1;FileTypes1.xojo_filetypeset;&h00000000352FB9F5;&h0000000000000000;false +Window=WndAdmin;WndAdmin.xojo_window;&h000000005D541828;&h0000000000000000;false +BuildSteps=Build Automation;Build Automation.xojo_code;&h00000000378B80A5;&h0000000000000000;false +Module=Kaju;../Kaju Classes/Kaju.xojo_code;&h0000000011400316;&h000000002570CF64;false +Module=KajuLocale;../Kaju Classes/KajuLocale.xojo_code;&h00000000020D2554;&h000000002570CF64;false +Window=KajuUpdateWindow;../Kaju Classes/KajuUpdateWindow.xojo_window;&h00000000018AE3D9;&h000000002570CF64;false +Class=UpdateChecker;../Kaju Classes/Kaju/UpdateChecker.xojo_code;&h0000000070CF0A50;&h0000000011400316;false +Class=KajuException;../Kaju Classes/Kaju/KajuException.xojo_code;&h000000003047231F;&h0000000011400316;false +Class=UpdateInformation;../Kaju Classes/Kaju/UpdateInformation.xojo_code;&h0000000079AE1ADC;&h0000000011400316;false +Class=BinaryInformation;../Kaju Classes/Kaju/BinaryInformation.xojo_code;&h000000000E8D70B5;&h0000000011400316;false +Class=HTTPSocketAsync;../Kaju Classes/Kaju/HTTPSocketAsync.xojo_code;&h000000006C1487FF;&h0000000011400316;false +Class=ZipShell;../Kaju Classes/Kaju/ZipShell.xojo_code;&h000000000CC15E9B;&h0000000011400316;false +Class=Information;../Kaju Classes/Kaju/Information.xojo_code;&h000000006497A7C4;&h0000000011400316;false +Class=UpdateInitiater;../Kaju Classes/Kaju/UpdateInitiater.xojo_code;&h000000004DBB48E5;&h0000000011400316;false +Folder=Controls;Controls;&h000000000E8B14E5;&h0000000000000000;false +Class=CheckBoxChanger;Controls/CheckBoxChanger.xojo_code;&h000000005115CD40;&h000000000E8B14E5;false +Class=PopupMenuChanger;Controls/PopupMenuChanger.xojo_code;&h0000000021277FFF;&h000000000E8B14E5;false +Folder=Other Classes;Other Classes;&h000000006AF5D169;&h0000000000000000;false +Class=TextFieldChanger;Controls/TextFieldChanger.xojo_code;&h000000004D090F7E;&h000000000E8B14E5;false +Class=TextAreaChanger;Controls/TextAreaChanger.xojo_code;&h000000000DD8825B;&h000000000E8B14E5;false +Class=FolderItemAlias;Other Classes/FolderItemAlias.xojo_code;&h0000000053EF1AE5;&h000000006AF5D169;false +Class=HTTPSSocket;../Kaju Classes/Kaju/HTTPSSocket.xojo_code;&h000000005ACDFAEB;&h0000000011400316;false +Class=KajuFile;../Admin Classes/KajuFile.xojo_code;&h000000001A7FF7FF;&h0000000000000000;false +Window=BinaryInformationControl;Controls/BinaryInformationControl.xojo_window;&h000000005D6E5FFF;&h000000000E8B14E5;false +Plist=Info;../Custom Plist/Info.plist;&h000000001F6587FF;&h00000000721CD7FF;false AppMenuBar=MainMenuBar MajorVersion=2 -MinorVersion=0 +MinorVersion=1 SubVersion=0 NonRelease=0 Release=3 InfoVersion=Kaju Admin -LongVersion=v.2.0 -ShortVersion=2.0 +LongVersion=v.2.1 +ShortVersion=2.1 WinCompanyName=MacTechnologies Consulting WinInternalName= WinProductName= @@ -59,4 +64,9 @@ UseBuildsFolder=True HiDPI=True CopyRedistNextToWindowsEXE=False IsWebProject=False +LinuxBuildArchitecture=1 +MacBuildArchitecture=1 +WindowsBuildArchitecture=1 OptimizationLevel=0 +WindowsVersions={35138b9a-5d96-4fbd-8e2d-a2440225f93a}|{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}|{1f676c76-80e1-4239-95bb-83d0f6d0da78}|{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a} +WindowsRunAs=0 diff --git a/Kaju Admin App/Other Classes/FolderItemAlias.xojo_code b/Kaju Admin App/Other Classes/FolderItemAlias.xojo_code index 5abee10..5d9168b 100644 --- a/Kaju Admin App/Other Classes/FolderItemAlias.xojo_code +++ b/Kaju Admin App/Other Classes/FolderItemAlias.xojo_code @@ -16,9 +16,9 @@ Protected Class FolderItemAlias #tag Method, Flags = &h0 Sub Operator_Convert(f As FolderItem) - if f IsA FolderItem then me.Constructor( f ) - - + if f IsA FolderItem then + me.Constructor( f ) + end if End Sub #tag EndMethod @@ -81,6 +81,7 @@ Protected Class FolderItemAlias Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -88,18 +89,23 @@ Protected Class FolderItemAlias Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -107,6 +113,7 @@ Protected Class FolderItemAlias Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Admin App/WndAdmin.xojo_window b/Kaju Admin App/WndAdmin.xojo_window index dbec0db..5bc0346 100644 --- a/Kaju Admin App/WndAdmin.xojo_window +++ b/Kaju Admin App/WndAdmin.xojo_window @@ -3,7 +3,6 @@ Begin Window WndAdmin BackColor = &cFFFFFF00 Backdrop = 0 CloseButton = True - Compatibility = "" Composite = True Frame = 0 FullScreen = False @@ -11,7 +10,7 @@ Begin Window WndAdmin HasBackColor = False Height = 680 ImplicitInstance= True - LiveResize = True + LiveResize = "True" MacProcID = 0 MaxHeight = 32000 MaximizeButton = True @@ -62,6 +61,7 @@ Begin Window WndAdmin ScrollbarHorizontal= False ScrollBarVertical= True SelectionType = 0 + ShowDropIndicator= False TabIndex = 0 TabPanelIndex = 0 TabStop = True @@ -69,6 +69,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 14 + Transparent = False Underline = False UseFocusRing = True Visible = True @@ -79,7 +80,7 @@ Begin Window WndAdmin Begin PushButton btnNew AutoDeactivate = True Bold = True - ButtonStyle = "6" + ButtonStyle = 6 Cancel = False Caption = "+" Default = False @@ -91,7 +92,7 @@ Begin Window WndAdmin Italic = False Left = 20 LockBottom = True - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = False @@ -103,6 +104,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 640 + Transparent = False Underline = False Visible = True Width = 20 @@ -110,7 +112,7 @@ Begin Window WndAdmin Begin PushButton btnDelete AutoDeactivate = True Bold = True - ButtonStyle = "6" + ButtonStyle = 6 Cancel = False Caption = "-" Default = False @@ -122,7 +124,7 @@ Begin Window WndAdmin Italic = False Left = 39 LockBottom = True - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = False @@ -134,6 +136,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 640 + Transparent = False Underline = False Visible = True Width = 20 @@ -175,6 +178,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 52 + Transparent = False Underline = False UseFocusRing = True Visible = True @@ -202,6 +206,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 12 TabPanelIndex = 0 + TabStop = True Text = "Version:" TextAlign = 0 TextColor = &c00000000 @@ -240,8 +245,9 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 119 + Transparent = False Underline = False - Value = 0 + Value = 3 Visible = True Width = 653 Begin TextAreaChanger fldReleaseNotes @@ -286,7 +292,8 @@ Begin Window WndAdmin TextFont = "System" TextSize = 0.0 TextUnit = 0 - Top = 193 + Top = 194 + Transparent = False Underline = False UseFocusRing = True Visible = True @@ -305,7 +312,7 @@ Begin Window WndAdmin LockLeft = True LockRight = True LockTop = False - Renderer = 0 + Renderer = 1 Scope = 2 TabIndex = 1 TabPanelIndex = 1 @@ -336,6 +343,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 11 TabPanelIndex = 1 + TabStop = True Text = "Preview:" TextAlign = 0 TextColor = &c00000000 @@ -370,6 +378,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 10 TabPanelIndex = 1 + TabStop = True Text = "Release Notes (HTML):" TextAlign = 0 TextColor = &c00000000 @@ -419,7 +428,8 @@ Begin Window WndAdmin TextFont = "System" TextSize = 0.0 TextUnit = 0 - Top = 194 + Top = 195 + Transparent = False Underline = False UseFocusRing = True Visible = True @@ -447,13 +457,14 @@ Begin Window WndAdmin Selectable = False TabIndex = 3 TabPanelIndex = 4 + TabStop = True Text = "URL:" TextAlign = 0 TextColor = &c00000000 TextFont = "System" TextSize = 0.0 TextUnit = 0 - Top = 194 + Top = 195 Transparent = False Underline = False Visible = True @@ -486,6 +497,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 162 + Transparent = False Underline = False Value = False Visible = True @@ -504,7 +516,7 @@ Begin Window WndAdmin LockLeft = True LockRight = True LockTop = True - Renderer = 0 + Renderer = 1 Scope = 2 TabIndex = 2 TabPanelIndex = 4 @@ -542,8 +554,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 7 TabPanelIndex = 1 TabStop = True @@ -552,6 +563,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -586,8 +598,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 8 TabPanelIndex = 1 TabStop = True @@ -596,6 +607,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -630,8 +642,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 9 TabPanelIndex = 1 TabStop = True @@ -640,6 +651,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = True Value = False Visible = True @@ -674,8 +686,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 2 TabPanelIndex = 1 TabStop = True @@ -684,6 +695,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -718,8 +730,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 3 TabPanelIndex = 1 TabStop = True @@ -728,6 +739,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -762,8 +774,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 4 TabPanelIndex = 1 TabStop = True @@ -772,6 +783,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -806,8 +818,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 5 TabPanelIndex = 1 TabStop = True @@ -816,6 +827,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -850,8 +862,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = True - MenuValue = 0 - Scope = 0 + Scope = 2 TabIndex = 6 TabPanelIndex = 1 TabStop = True @@ -860,6 +871,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 169 + Transparent = False Underline = False Value = False Visible = True @@ -887,6 +899,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 0 TabPanelIndex = 2 + TabStop = True Text = "Use ‘$VERSION$’ in the URL to insert the version on export" TextAlign = 1 TextColor = &c00000000 @@ -921,6 +934,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 0 TabPanelIndex = 3 + TabStop = True Text = "Use ‘$VERSION$’ in the URL to insert the version on export" TextAlign = 1 TextColor = &c00000000 @@ -951,7 +965,7 @@ Begin Window WndAdmin LockLeft = False LockRight = True LockTop = False - Scope = 0 + Scope = 2 State = 0 TabIndex = 12 TabPanelIndex = 1 @@ -960,11 +974,79 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 382 + Transparent = False Underline = False Value = False Visible = True Width = 157 End + Begin PopupMenuChanger pumImageScale + AutoDeactivate = True + Bold = False + DataField = "ImageScale" + DataSource = "" + Enabled = False + Height = 20 + HelpTag = "" + Index = -2147483648 + InitialParent = "TabPanel1" + InitialValue = "1\n2\n3" + Italic = False + Left = 804 + ListIndex = 0 + LockBottom = False + LockedInPosition= False + LockLeft = False + LockRight = True + LockTop = True + Scope = 2 + TabIndex = 4 + TabPanelIndex = 4 + TabStop = True + TextFont = "System" + TextSize = 0.0 + TextUnit = 0 + Top = 161 + Transparent = False + Underline = False + Visible = True + Width = 80 + End + Begin Label Label1 + AutoDeactivate = True + Bold = False + DataField = "" + DataSource = "" + Enabled = True + Height = 20 + HelpTag = "" + Index = 10 + InitialParent = "TabPanel1" + Italic = False + Left = 725 + LockBottom = False + LockedInPosition= False + LockLeft = True + LockRight = False + LockTop = True + Multiline = False + Scope = 2 + Selectable = False + TabIndex = 5 + TabPanelIndex = 4 + TabStop = True + Text = "Scale:" + TextAlign = 0 + TextColor = &c00000000 + TextFont = "System" + TextSize = 0.0 + TextUnit = 0 + Top = 162 + Transparent = False + Underline = False + Visible = True + Width = 67 + End End Begin TextFieldChanger fldAppName AcceptTabs = False @@ -1003,6 +1085,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 18 + Transparent = False Underline = False UseFocusRing = True Visible = True @@ -1030,6 +1113,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 11 TabPanelIndex = 0 + TabStop = True Text = "App Name:" TextAlign = 0 TextColor = &c00000000 @@ -1069,6 +1153,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 19 + Transparent = False Underline = False Value = False Visible = True @@ -1107,7 +1192,7 @@ Begin Window WndAdmin Begin PushButton btnCopyPublicKey AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = False Caption = "Copy RSA Public Key" Default = False @@ -1119,7 +1204,7 @@ Begin Window WndAdmin Italic = False Left = 251 LockBottom = True - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = False @@ -1131,6 +1216,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 640 + Transparent = False Underline = False Visible = True Width = 186 @@ -1166,6 +1252,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 14 TabPanelIndex = 0 + TabStop = True Text = "None" TextAlign = 0 TextColor = &c00000000 @@ -1200,6 +1287,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 13 TabPanelIndex = 0 + TabStop = True Text = "Platforms:" TextAlign = 0 TextColor = &c00000000 @@ -1210,12 +1298,12 @@ Begin Window WndAdmin Transparent = False Underline = False Visible = True - Width = 100 + Width = 80 End Begin PushButton btnExport AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = False Caption = "Export..." Default = False @@ -1227,7 +1315,7 @@ Begin Window WndAdmin Italic = False Left = 819 LockBottom = True - LockedInPosition= False + LockedInPosition= True LockLeft = False LockRight = True LockTop = False @@ -1239,6 +1327,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 639 + Transparent = False Underline = False Visible = True Width = 85 @@ -1246,7 +1335,7 @@ Begin Window WndAdmin Begin PushButton btnDuplicate AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = False Caption = "Dupe" Default = False @@ -1258,7 +1347,7 @@ Begin Window WndAdmin Italic = False Left = 158 LockBottom = True - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = False @@ -1270,6 +1359,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 641 + Transparent = False Underline = False Visible = True Width = 65 @@ -1299,12 +1389,11 @@ Begin Window WndAdmin Italic = False Left = 684 LockBottom = True - LockedInPosition= False + LockedInPosition= True LockLeft = False LockRight = True LockTop = False - MenuValue = -1 - Scope = 0 + Scope = 2 TabIndex = 9 TabPanelIndex = 0 TabStop = True @@ -1313,6 +1402,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 639 + Transparent = False Underline = False Value = False Visible = True @@ -1356,6 +1446,7 @@ Begin Window WndAdmin TextSize = 0.0 TextUnit = 0 Top = 85 + Transparent = False Underline = False UseFocusRing = True Visible = True @@ -1383,6 +1474,7 @@ Begin Window WndAdmin Selectable = False TabIndex = 17 TabPanelIndex = 0 + TabStop = True Text = "Min. Req. Version:" TextAlign = 0 TextColor = &c00000000 @@ -1395,6 +1487,34 @@ Begin Window WndAdmin Visible = True Width = 117 End + Begin Kaju.UpdateInformation objReleaseNotesProcessor + AppName = "" + DisplayReleaseNotes= "" + Image = 0 + ImageScale = 1 + ImageURL = "" + Index = -2147483648 + IsValid = False + LockedInPosition= False + MinimumRequiredVersion= "" + ReleaseNotes = "" + ReleaseNotesFromURL= "" + RequiresPayment = False + Scope = 2 + StageCode = 0 + TabPanelIndex = 0 + UseTransparency = True + Version = "" + VersionAsDouble = 0.0 + End + Begin Timer tmrAdjustControls + Index = -2147483648 + LockedInPosition= False + Mode = 0 + Period = 20 + Scope = 2 + TabPanelIndex = 0 + End End #tag EndWindow @@ -1436,13 +1556,6 @@ End #tag Event Sub Close() - if RelativeToFolderItem isa FolderItem then - if RelativeToFolderItem.Exists then - RelativeToFolderItem.Delete - end if - RelativeToFolderItem = nil - end if - // // Tear down the BinaryInformationControls // @@ -1458,8 +1571,6 @@ End #tag Event Sub Open() - RelativeToFolderItem = GetTemporaryFolderItem - // // Create binary controls // @@ -1482,6 +1593,7 @@ End cc.LockRight = true cc.LockTop = true cc.LockBottom = false + 'cc.Transparent = false if binaryName.InStr( "64" ) <> 0 then cc.EmbedWithinPanel TabPanel1, tpIndex64, useLeft, useTop64 @@ -1527,8 +1639,9 @@ End #tag Method, Flags = &h21 - Private Sub AdjustControls() - if self.Loading then + Private Sub AdjustControls(immediate As Boolean = False) + if not immediate or self.Loading then + tmrAdjustControls.Mode = Timer.ModeSingle return end if @@ -1627,6 +1740,7 @@ End select case c case IsA TextEdit case IsA CheckBox + case IsA PopupMenu else continue for i end @@ -1638,8 +1752,8 @@ End bc.Clear next - hvReleaseNotesPreview.LoadPage( "", nil ) - hvImagePreview.LoadPage( "", nil ) + hvReleaseNotesPreview.LoadPage( kNoDataHTML, nil ) + hvImagePreview.LoadPage( kNoDataHTML, nil ) self.Loading = false @@ -1663,6 +1777,10 @@ End dim cb as CheckBox = CheckBox( c ) value = cb.DataField + case IsA PopUpMenu + dim pum as PopupMenu = PopupMenu( c ) + value = pum.DataField + end select return value @@ -1683,6 +1801,12 @@ End dim cb as CheckBox = CheckBox( c ) r = cb.Value + case IsA PopupMenu + dim pum as PopupMenu = PopupMenu( c ) + if pum.ListIndex <> -1 then + r = pum.List( pum.ListIndex ) + end if + end select return r @@ -1702,6 +1826,20 @@ End dim cb as CheckBox = CheckBox( c ) cb.Value = value.BooleanValue + case IsA PopupMenu + dim pum as PopupMenu = PopupMenu( c ) + if value.IsNull then + pum.ListIndex = 0 + else + for i as integer = pum.ListCount - 1 downto 0 + if pum.List( i ) = value.StringValue then + pum.ListIndex = i + exit + end if + next + + end if + else raise new KeyNotFoundException @@ -1748,10 +1886,13 @@ End #tag EndMethod #tag Method, Flags = &h21 - Private Function DoSave() As Boolean + Private Function DoSave(f As FolderItem = Nil) As Boolean StoreFieldsToVersionRow() - dim f as FolderItem = Document + if f is nil then + f = Document + end if + if f is nil then return DoSaveAs() end if @@ -1761,6 +1902,7 @@ End dim r as boolean MyKajuFile.SaveTo( f ) r = true + Document = f ContentsChanged = false Exception err as KajuException @@ -1806,8 +1948,7 @@ End end if end if - Document = f - r = DoSave() + r = DoSave( f ) end if UpdateWindowTitle @@ -2134,9 +2275,9 @@ End Private Platforms() As String #tag EndProperty - #tag Property, Flags = &h21 - Private RelativeToFolderItem As FolderItem - #tag EndProperty + + #tag Constant, Name = kNoDataHTML, Type = String, Dynamic = False, Default = \"
", Scope = Private + #tag EndConstant #tag EndWindowCode @@ -2193,14 +2334,24 @@ End #tag Events fldReleaseNotes #tag Event Sub TextChange() + objReleaseNotesProcessor.ReleaseNotes = me.Text tmrUpdateReleaseNotesPreview.Mode = Timer.ModeSingle tmrUpdateReleaseNotesPreview.Reset + + #if TargetWindows then + hvReleaseNotesPreview.LoadPage( kNoDataHTML, nil ) + + dim releaseNotes as string = ControlValue( fldReleaseNotes ).StringValue + hvReleaseNotesPreview.LoadPage releaseNotes, nil + me.SetFocus + #endif + End Sub #tag EndEvent #tag EndEvents #tag Events hvReleaseNotesPreview #tag Event - Function NewWindow() As HTMLViewer + Function NewWindow() As Object return hvNewWindow End Function #tag EndEvent @@ -2211,18 +2362,37 @@ End #pragma unused URL End Function #tag EndEvent + #tag Event + Sub DocumentComplete(url as String) + #pragma unused URL + + self.Loading = false + End Sub + #tag EndEvent + #tag Event + Sub Error(errorNumber as Integer, errorMessage as String) + #pragma unused errorNumber + #pragma unused errorMessage + + break + End Sub + #tag EndEvent #tag EndEvents #tag Events fldImageURL #tag Event Sub TextChange() tmrUpdateImagePreview.Mode = Timer.ModeSingle tmrUpdateImagePreview.Reset + + #if TargetWindows then + hvImagePreview.LoadPage kNoDataHTML, nil + #endif End Sub #tag EndEvent #tag EndEvents #tag Events hvImagePreview #tag Event - Function NewWindow() As HTMLViewer + Function NewWindow() As Object return hvNewWindow End Function #tag EndEvent @@ -2233,6 +2403,21 @@ End #pragma unused URL End Function #tag EndEvent + #tag Event + Sub DocumentComplete(url as String) + #pragma unused URL + + self.Loading = false + End Sub + #tag EndEvent + #tag Event + Sub Error(errorNumber as Integer, errorMessage as String) + #pragma unused errorNumber + #pragma unused errorMessage + + break + End Sub + #tag EndEvent #tag EndEvents #tag Events btnStyle #tag Event @@ -2274,13 +2459,20 @@ End Sub Action() self.Loading = true - dim releaseNotes as string = ControlValue( fldReleaseNotes ).StringValue - if not cbPre2Preview.Value then - releaseNotes = Kaju.ProcessReleaseNotes( releaseNotes ) + dim releaseNotes as string + if cbPre2Preview.Value then + releaseNotes = ControlValue( fldReleaseNotes ).StringValue + else + releaseNotes = objReleaseNotesProcessor.DisplayReleaseNotes end if - hvReleaseNotesPreview.LoadPage( releaseNotes, RelativeToFolderItem ) - self.Loading = false + dim saveControl as RectControl = self.Focus + hvReleaseNotesPreview.LoadPage( releaseNotes, nil ) + self.Focus = saveControl + // + // The htmlViewer will set Loading to false + // + End Sub #tag EndEvent #tag EndEvents @@ -2309,7 +2501,10 @@ End hvImagePreview.LoadURL( fldImageURL.Text ) - self.Loading = false + // + // The htmlViewer will set Loading to false + // + End Sub #tag EndEvent #tag EndEvents @@ -2383,42 +2578,61 @@ End End Sub #tag EndEvent #tag EndEvents +#tag Events objReleaseNotesProcessor + #tag Event + Sub ReleaseNotesReceived() + tmrUpdateReleaseNotesPreview.Mode = Timer.ModeSingle + tmrUpdateReleaseNotesPreview.Reset + End Sub + #tag EndEvent +#tag EndEvents +#tag Events tmrAdjustControls + #tag Event + Sub Action() + AdjustControls true + + End Sub + #tag EndEvent +#tag EndEvents #tag ViewBehavior #tag ViewProperty - Name="BackColor" + Name="MinimumWidth" Visible=true - Group="Appearance" - InitialValue="&hFFFFFF" - Type="Color" + Group="Size" + InitialValue="64" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Backdrop" + Name="MinimumHeight" Visible=true - Group="Appearance" - Type="Picture" - EditorType="Picture" + Group="Size" + InitialValue="64" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="CloseButton" + Name="MaximumWidth" Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" + Group="Size" + InitialValue="32000" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Composite" + Name="MaximumHeight" Visible=true - Group="Appearance" - InitialValue="False" - Type="Boolean" + Group="Size" + InitialValue="32000" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Frame" + Name="Type" Visible=true - Group="Appearance" + Group="Frame" InitialValue="0" - Type="Integer" + Type="Types" EditorType="Enum" #tag EnumValues "0 - Document" @@ -2435,148 +2649,155 @@ End #tag EndEnumValues #tag EndViewProperty #tag ViewProperty - Name="FullScreen" - Group="Appearance" - InitialValue="False" + Name="HasCloseButton" + Visible=true + Group="Frame" + InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="FullScreenButton" + Name="HasMaximizeButton" Visible=true - Group="Appearance" - InitialValue="False" + Group="Frame" + InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="HasBackColor" + Name="HasMinimizeButton" Visible=true - Group="Appearance" + Group="Frame" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="HasFullScreenButton" + Visible=true + Group="Frame" InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Height" + Name="DefaultLocation" Visible=true - Group="Position" - InitialValue="400" - Type="Integer" + Group="Behavior" + InitialValue="0" + Type="Locations" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Parent Window" + "2 - Main Screen" + "3 - Parent Window Screen" + "4 - Stagger" + #tag EndEnumValues #tag EndViewProperty #tag ViewProperty - Name="ImplicitInstance" + Name="HasBackgroundColor" Visible=true - Group="Appearance" - InitialValue="True" + Group="Background" + InitialValue="False" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Interfaces" + Name="BackgroundColor" Visible=true - Group="ID" - Type="String" - EditorType="String" + Group="Background" + InitialValue="&hFFFFFF" + Type="Color" + EditorType="Color" #tag EndViewProperty #tag ViewProperty - Name="LiveResize" + Name="Backdrop" Visible=true Group="Appearance" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" + InitialValue="" + Type="Picture" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Loading" - Group="Behavior" + Name="Composite" + Visible=true + Group="Appearance" + InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MacProcID" - Visible=true + Name="FullScreen" + Visible=false Group="Appearance" - InitialValue="0" - Type="Integer" + InitialValue="False" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MaxHeight" + Name="Height" Visible=true Group="Position" - InitialValue="32000" + InitialValue="400" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MaximizeButton" + Name="ImplicitInstance" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="MaxWidth" - Visible=true - Group="Position" - InitialValue="32000" - Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MenuBar" + Name="Interfaces" Visible=true - Group="Appearance" - Type="MenuBar" - EditorType="MenuBar" + Group="ID" + InitialValue="" + Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MenuBarVisible" - Group="Appearance" - InitialValue="True" + Name="Loading" + Visible=false + Group="Behavior" + InitialValue="" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MinHeight" + Name="MacProcID" Visible=true - Group="Position" - InitialValue="64" + Group="Appearance" + InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MinimizeButton" + Name="MenuBar" Visible=true Group="Appearance" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" + InitialValue="" + Type="MenuBar" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MinWidth" - Visible=true - Group="Position" - InitialValue="64" - Type="Integer" + Name="MenuBarVisible" + Visible=false + Group="Appearance" + InitialValue="True" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" - #tag EndViewProperty - #tag ViewProperty - Name="Placement" - Visible=true - Group="Position" - InitialValue="0" - Type="Integer" - EditorType="Enum" - #tag EnumValues - "0 - Default" - "1 - Parent Window" - "2 - Main Screen" - "3 - Parent Window Screen" - "4 - Stagger" - #tag EndEnumValues + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Resizeable" @@ -2584,14 +2805,15 @@ End Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Title" @@ -2599,6 +2821,7 @@ End Group="Appearance" InitialValue="Untitled" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Visible" @@ -2606,7 +2829,7 @@ End Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Width" @@ -2614,5 +2837,6 @@ End Group="Position" InitialValue="600" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior diff --git a/Kaju Admin CLI/FileHandlerSubApplication.xojo_code b/Kaju Admin CLI/FileHandlerSubApplication.xojo_code index d91b316..bba9add 100644 --- a/Kaju Admin CLI/FileHandlerSubApplication.xojo_code +++ b/Kaju Admin CLI/FileHandlerSubApplication.xojo_code @@ -27,13 +27,17 @@ Inherits SubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -43,6 +47,7 @@ Inherits SubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -50,18 +55,23 @@ Inherits SubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -69,10 +79,13 @@ Inherits SubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Kaju Admin CLI.xojo_project b/Kaju Admin CLI/Kaju Admin CLI.xojo_project index 31aa2b9..feda6b3 100644 --- a/Kaju Admin CLI/Kaju Admin CLI.xojo_project +++ b/Kaju Admin CLI/Kaju Admin CLI.xojo_project @@ -1,45 +1,48 @@ Type=Console -RBProjectVersion=2017.011 +RBProjectVersion=2019.031 MinIDEVersion=20070100 -Class=App;App.xojo_code;&h31FD87FF;&h0;false -Module=FormatCodePreferences;FormatCodePreferences.xojo_code;&h2977F6F1;&h0;false -BuildSteps=Build Automation;Build Automation.xojo_code;&h28989FFF;&h0;false -Folder=Kaju Classes;../Kaju Classes;&h2570CF64;&h0;false -Class=KajuFile;../Admin Classes/KajuFile.xojo_code;&h1A7FF7FF;&h0;false -Folder=Other Classes;../Other Classes;&hF6057FF;&h0;false -Class=SubApplication;SubApplication.xojo_code;&h2E4257FF;&h0;false -Class=FileHandlerSubApplication;FileHandlerSubApplication.xojo_code;&h6664E7FF;&h0;false -Class=VersionHandlerSubApplication;VersionHandlerSubApplication.xojo_code;&h2332B7FF;&h0;false -Folder=OptionParser;../Other Classes/OptionParser;&h797A37FF;&hF6057FF;false -Module=Kaju;../Kaju Classes/Kaju.xojo_code;&h11400316;&h2570CF64;false -Class=KajuException;../Kaju Classes/Kaju/KajuException.xojo_code;&h3047231F;&h11400316;false -Class=UpdateInformation;../Kaju Classes/Kaju/UpdateInformation.xojo_code;&h79AE1ADC;&h11400316;false -Class=BinaryInformation;../Kaju Classes/Kaju/BinaryInformation.xojo_code;&hE8D70B5;&h11400316;false -Class=Information;../Kaju Classes/Kaju/Information.xojo_code;&h6497A7C4;&h11400316;false -Module=KajuLocale;../Kaju Classes/KajuLocale.xojo_code;&h20D2554;&h2570CF64;false -Folder=Sub Applications;Sub Applications;&h58EA2FFF;&h0;false -Class=AddVersionApp;Sub Applications/AddVersionApp.xojo_code;&h7DC607FF;&h58EA2FFF;false -Class=CreateApp;Sub Applications/CreateApp.xojo_code;&h629A87FF;&h58EA2FFF;false -Class=DeleteVersionApp;Sub Applications/DeleteVersionApp.xojo_code;&h518477FF;&h58EA2FFF;false -Class=EditVersionApp;Sub Applications/EditVersionApp.xojo_code;&h39BFF7FF;&h58EA2FFF;false -Class=ExportApp;Sub Applications/ExportApp.xojo_code;&h34271FFF;&h58EA2FFF;false -Class=GetKeyApp;Sub Applications/GetKeyApp.xojo_code;&h475957FF;&h58EA2FFF;false -Class=ListVersionsApp;Sub Applications/ListVersionsApp.xojo_code;&h8ED2FFF;&h58EA2FFF;false -Class=VersionInfoApp;Sub Applications/VersionInfoApp.xojo_code;&h788B8FFF;&h58EA2FFF;false -Class=Option;../Other Classes/OptionParser/Option.xojo_code;&h739D11C7;&h797A37FF;false -Class=OptionInvalidKeyValueException;../Other Classes/OptionParser/OptionInvalidKeyValueException.xojo_code;&h72B88CF5;&h797A37FF;false -Class=OptionMissingKeyException;../Other Classes/OptionParser/OptionMissingKeyException.xojo_code;&h44C7F771;&h797A37FF;false -Class=OptionParser;../Other Classes/OptionParser/OptionParser.xojo_code;&h25CD9122;&h797A37FF;false -Class=OptionParserException;../Other Classes/OptionParser/OptionParserException.xojo_code;&h5CB2B525;&h797A37FF;false -Class=OptionUnrecognizedKeyException;../Other Classes/OptionParser/OptionUnrecognizedKeyException.xojo_code;&h12104F75;&h797A37FF;false +OrigIDEVersion=00000000 +Class=App;App.xojo_code;&h0000000031FD87FF;&h0000000000000000;false +Folder=Custom Plist;../Custom Plist;&h00000000291C0FFF;&h0000000000000000;false +Module=FormatCodePreferences;FormatCodePreferences.xojo_code;&h000000002977F6F1;&h0000000000000000;false +BuildSteps=Build Automation;Build Automation.xojo_code;&h0000000028989FFF;&h0000000000000000;false +Folder=Kaju Classes;../Kaju Classes;&h000000002570CF64;&h0000000000000000;false +Class=KajuFile;../Admin Classes/KajuFile.xojo_code;&h000000001A7FF7FF;&h0000000000000000;false +Folder=Other Classes;../Other Classes;&h000000000F6057FF;&h0000000000000000;false +Class=SubApplication;SubApplication.xojo_code;&h000000002E4257FF;&h0000000000000000;false +Class=FileHandlerSubApplication;FileHandlerSubApplication.xojo_code;&h000000006664E7FF;&h0000000000000000;false +Class=VersionHandlerSubApplication;VersionHandlerSubApplication.xojo_code;&h000000002332B7FF;&h0000000000000000;false +Folder=OptionParser;../Other Classes/OptionParser;&h00000000797A37FF;&h000000000F6057FF;false +Module=Kaju;../Kaju Classes/Kaju.xojo_code;&h0000000011400316;&h000000002570CF64;false +Class=KajuException;../Kaju Classes/Kaju/KajuException.xojo_code;&h000000003047231F;&h0000000011400316;false +Class=UpdateInformation;../Kaju Classes/Kaju/UpdateInformation.xojo_code;&h0000000079AE1ADC;&h0000000011400316;false +Class=BinaryInformation;../Kaju Classes/Kaju/BinaryInformation.xojo_code;&h000000000E8D70B5;&h0000000011400316;false +Class=Information;../Kaju Classes/Kaju/Information.xojo_code;&h000000006497A7C4;&h0000000011400316;false +Module=KajuLocale;../Kaju Classes/KajuLocale.xojo_code;&h00000000020D2554;&h000000002570CF64;false +Folder=Sub Applications;Sub Applications;&h0000000058EA2FFF;&h0000000000000000;false +Class=AddVersionApp;Sub Applications/AddVersionApp.xojo_code;&h000000007DC607FF;&h0000000058EA2FFF;false +Class=CreateApp;Sub Applications/CreateApp.xojo_code;&h00000000629A87FF;&h0000000058EA2FFF;false +Class=DeleteVersionApp;Sub Applications/DeleteVersionApp.xojo_code;&h00000000518477FF;&h0000000058EA2FFF;false +Class=EditVersionApp;Sub Applications/EditVersionApp.xojo_code;&h0000000039BFF7FF;&h0000000058EA2FFF;false +Class=ExportApp;Sub Applications/ExportApp.xojo_code;&h0000000034271FFF;&h0000000058EA2FFF;false +Class=GetKeyApp;Sub Applications/GetKeyApp.xojo_code;&h00000000475957FF;&h0000000058EA2FFF;false +Class=ListVersionsApp;Sub Applications/ListVersionsApp.xojo_code;&h0000000008ED2FFF;&h0000000058EA2FFF;false +Class=VersionInfoApp;Sub Applications/VersionInfoApp.xojo_code;&h00000000788B8FFF;&h0000000058EA2FFF;false +Class=Option;../Other Classes/OptionParser/Option.xojo_code;&h00000000739D11C7;&h00000000797A37FF;false +Class=OptionInvalidKeyValueException;../Other Classes/OptionParser/OptionInvalidKeyValueException.xojo_code;&h0000000072B88CF5;&h00000000797A37FF;false +Class=OptionMissingKeyException;../Other Classes/OptionParser/OptionMissingKeyException.xojo_code;&h0000000044C7F771;&h00000000797A37FF;false +Class=OptionParser;../Other Classes/OptionParser/OptionParser.xojo_code;&h0000000025CD9122;&h00000000797A37FF;false +Class=OptionParserException;../Other Classes/OptionParser/OptionParserException.xojo_code;&h000000005CB2B525;&h00000000797A37FF;false +Class=OptionUnrecognizedKeyException;../Other Classes/OptionParser/OptionUnrecognizedKeyException.xojo_code;&h0000000012104F75;&h00000000797A37FF;false +Plist=Info;../Custom Plist/Info.plist;&h000000006407F7FF;&h00000000291C0FFF;false MajorVersion=2 -MinorVersion=0 +MinorVersion=1 SubVersion=0 NonRelease=0 Release=3 InfoVersion= -LongVersion=v.2.0 -ShortVersion=2.0 +LongVersion=v.2.1 +ShortVersion=2.1 WinCompanyName=MacTechnologies Consulting WinInternalName=kaju WinProductName=Kaju CLI @@ -63,4 +66,9 @@ UseGDIPlus=False UseBuildsFolder=True CopyRedistNextToWindowsEXE=False IsWebProject=False +LinuxBuildArchitecture=1 +MacBuildArchitecture=1 +WindowsBuildArchitecture=1 OptimizationLevel=0 +WindowsVersions={35138b9a-5d96-4fbd-8e2d-a2440225f93a}|{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}|{1f676c76-80e1-4239-95bb-83d0f6d0da78}|{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a} +WindowsRunAs=0 diff --git a/Kaju Admin CLI/Sub Applications/AddVersionApp.xojo_code b/Kaju Admin CLI/Sub Applications/AddVersionApp.xojo_code index 0180ba3..f3d3080 100644 --- a/Kaju Admin CLI/Sub Applications/AddVersionApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/AddVersionApp.xojo_code @@ -62,13 +62,17 @@ Inherits VersionHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -78,6 +82,7 @@ Inherits VersionHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -85,18 +90,23 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -104,10 +114,13 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/CreateApp.xojo_code b/Kaju Admin CLI/Sub Applications/CreateApp.xojo_code index a6bd54f..409016c 100644 --- a/Kaju Admin CLI/Sub Applications/CreateApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/CreateApp.xojo_code @@ -54,13 +54,17 @@ Inherits SubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -70,6 +74,7 @@ Inherits SubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -77,18 +82,23 @@ Inherits SubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -96,10 +106,13 @@ Inherits SubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/DeleteVersionApp.xojo_code b/Kaju Admin CLI/Sub Applications/DeleteVersionApp.xojo_code index 2e5d3f6..f5d1c2e 100644 --- a/Kaju Admin CLI/Sub Applications/DeleteVersionApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/DeleteVersionApp.xojo_code @@ -39,13 +39,17 @@ Inherits VersionHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -55,6 +59,7 @@ Inherits VersionHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -62,18 +67,23 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -81,10 +91,13 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/EditVersionApp.xojo_code b/Kaju Admin CLI/Sub Applications/EditVersionApp.xojo_code index eddb87c..f8b9cc3 100644 --- a/Kaju Admin CLI/Sub Applications/EditVersionApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/EditVersionApp.xojo_code @@ -279,13 +279,17 @@ Inherits VersionHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -295,6 +299,7 @@ Inherits VersionHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -302,18 +307,23 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -321,10 +331,13 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/ExportApp.xojo_code b/Kaju Admin CLI/Sub Applications/ExportApp.xojo_code index e9c1724..5a8f570 100644 --- a/Kaju Admin CLI/Sub Applications/ExportApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/ExportApp.xojo_code @@ -46,13 +46,17 @@ Inherits FileHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -62,6 +66,7 @@ Inherits FileHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -69,18 +74,23 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -88,10 +98,13 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/GetKeyApp.xojo_code b/Kaju Admin CLI/Sub Applications/GetKeyApp.xojo_code index 9456a0e..bac3fcb 100644 --- a/Kaju Admin CLI/Sub Applications/GetKeyApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/GetKeyApp.xojo_code @@ -34,13 +34,17 @@ Inherits FileHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -50,6 +54,7 @@ Inherits FileHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -57,18 +62,23 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -76,10 +86,13 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/ListVersionsApp.xojo_code b/Kaju Admin CLI/Sub Applications/ListVersionsApp.xojo_code index 7dad2c2..9338911 100644 --- a/Kaju Admin CLI/Sub Applications/ListVersionsApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/ListVersionsApp.xojo_code @@ -121,13 +121,17 @@ Inherits FileHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -137,6 +141,7 @@ Inherits FileHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -144,18 +149,23 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -163,10 +173,13 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/Sub Applications/VersionInfoApp.xojo_code b/Kaju Admin CLI/Sub Applications/VersionInfoApp.xojo_code index ef7e319..f0eda5a 100644 --- a/Kaju Admin CLI/Sub Applications/VersionInfoApp.xojo_code +++ b/Kaju Admin CLI/Sub Applications/VersionInfoApp.xojo_code @@ -79,13 +79,17 @@ Inherits VersionHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -95,6 +99,7 @@ Inherits VersionHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -102,18 +107,23 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -121,10 +131,13 @@ Inherits VersionHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Admin CLI/VersionHandlerSubApplication.xojo_code b/Kaju Admin CLI/VersionHandlerSubApplication.xojo_code index c454991..86d5c22 100644 --- a/Kaju Admin CLI/VersionHandlerSubApplication.xojo_code +++ b/Kaju Admin CLI/VersionHandlerSubApplication.xojo_code @@ -46,13 +46,17 @@ Inherits FileHandlerSubApplication #tag ViewBehavior #tag ViewProperty Name="AdditionalHelp" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Description" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -62,6 +66,7 @@ Inherits FileHandlerSubApplication Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -69,18 +74,23 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -88,10 +98,13 @@ Inherits FileHandlerSubApplication Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Usage" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty diff --git a/Kaju Classes/Kaju.xojo_code b/Kaju Classes/Kaju.xojo_code index a83f539..53fddb0 100644 --- a/Kaju Classes/Kaju.xojo_code +++ b/Kaju Classes/Kaju.xojo_code @@ -225,101 +225,29 @@ Protected Module Kaju End Sub #tag EndMethod - #tag Method, Flags = &h1, CompatibilityFlags = (TargetWeb and (Target32Bit or Target64Bit)) or (TargetDesktop and (Target32Bit or Target64Bit)) or (TargetIOS and (Target32Bit or Target64Bit)) - Protected Function ProcessReleaseNotes(notes As String) As String - // - // The release notes might be straight HTML or them might be a URL. - // If the latter, the remainder will be alternate notes. - // This method will determine which it is and, if the latter, will - // attempt to fetch the notes. If it can't, it will return the alternate - // notes if any, or a message. - // - // The URL may start the first line followed by an EOL or may be in an - // HTML comment that starts the first line. The latter form will maintain - // better compatibility with previous versions of Kaju. - // - // Examples: - // - // http://something.com/UpdateInformation.json - // - // + #tag Method, Flags = &h1, CompatibilityFlags = (TargetHasGUI) + Protected Sub StartUpdate(initiater As Kaju.UpdateInitiater) + App.UpdateInitiater = initiater + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Function StripURLCredentials(url As String) As String // - // + // Strips credentials from the given url // - static noInfoHTML as string = "" + KajuLocale.kNoUpdateInfoMessage + "" - - static rxURLSplitter as RegEx - if rxURLSplitter is nil then - rxURLSplitter = new RegEx - rxURLSplitter.SearchPattern = _ - "(?mi-Us)\A\x20*(?|(?:(http[^\s]+)\x20*\R)|(?:))([\s\S]*)" - end if - - dim r as string = notes + dim rx as new RegEx + rx.SearchPattern = "(://|^)(\w+:\w*)@" + rx.ReplacementPattern = "$1" - dim matchURL as RegExMatch = rxURLSplitter.Search( notes) - if matchURL isa RegExMatch then - dim url as string = matchURL.SubExpressionString( 1 ).Trim - dim alternateNotes as string = matchURL.SubExpressionString( 2 ).Trim - - dim redirector as new Kaju.HTTPSSocket - url = redirector.GetRedirectAddress( url, 5 ) - - dim http as new Kaju.HTTPSSocket - dim raw as string = http.Get( url, 5 ) - if http.HTTPStatusCode = 404 or raw.Trim = "" then - r = alternateNotes - else - // - // Adjust the encoding - // - - dim enc as TextEncoding - - // - // See if the html contains a charset - // - static rxCharSetFinder as RegEx - if rxCharSetFinder is nil then - rxCharSetFinder = new RegEx - rxCharSetFinder.SearchPattern = " "" then - url = headers.Value( "Location" ) - else - exit - end if - if isFinite then - maximumIterations = maximumIterations - 1 - end if - loop until isFinite and maximumIterations = 0 // Will never end if maxiumIterations < 0 to start - - return url.Trim - - End Function - #tag EndMethod - #tag Method, Flags = &h0 Sub SendRequest(method As String, url As String) SetSecure( url ) @@ -133,20 +99,23 @@ Inherits HTTPSecureSocket self.Port = 80 end if + SetRequestHeader "Cache-Control", "private, no-cache, max-age=0" + SetRequestHeader "Pragma", "no-cache" + // // See if the username and password has been specified // dim rx as new RegEx - rx.SearchPattern = "^(?:https?://)([^:/\x20@]+):([^:/\x20@]*)@(.*)" + rx.SearchPattern = "^(https?://)([^:/\x20@]+):([^:/\x20@]*)@(.*)" dim match as RegExMatch = rx.Search( url ) if match is nil then Username = "" Password = "" else - Username = DecodeURLComponent( match.SubExpressionString( 1 ) ) - Password = DecodeURLComponent( match.SubExpressionString( 2 ) ) - url = match.SubExpressionString( 3 ) + Username = DecodeURLComponent( match.SubExpressionString( 2 ) ) + Password = DecodeURLComponent( match.SubExpressionString( 3 ) ) + url = match.SubExpressionString( 1 ) + match.SubExpressionString( 4 ) end if End Sub @@ -176,76 +145,83 @@ Inherits HTTPSecureSocket #tag ViewBehavior + #tag ViewProperty + Name="SSLConnectionType" + Visible=true + Group="Behavior" + InitialValue="3" + Type="SSLConnectionTypes" + EditorType="Enum" + #tag EnumValues + "1 - SSLv23" + "3 - TLSv1" + "4 - TLSv11" + "5 - TLSv12" + #tag EndEnumValues + #tag EndViewProperty #tag ViewProperty Name="CertificateFile" Visible=true Group="Behavior" + InitialValue="" Type="FolderItem" - EditorType="File" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="CertificatePassword" Visible=true Group="Behavior" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="CertificateRejectionFile" Visible=true Group="Behavior" + InitialValue="" Type="FolderItem" - EditorType="File" - #tag EndViewProperty - #tag ViewProperty - Name="ConnectionType" - Visible=true - Group="Behavior" - InitialValue="3" - Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="ForceSecure" + Visible=false Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" + InitialValue="" Type="Integer" - EditorType="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="Left" - Visible=true - Group="Position" - Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Secure" Visible=true Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" - #tag EndViewProperty - #tag ViewProperty - Name="Top" - Visible=true - Group="Position" - Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/Kaju/HTTPSocketAsync.xojo_code b/Kaju Classes/Kaju/HTTPSocketAsync.xojo_code new file mode 100644 index 0000000..89d55fd --- /dev/null +++ b/Kaju Classes/Kaju/HTTPSocketAsync.xojo_code @@ -0,0 +1,235 @@ +#tag Class +Protected Class HTTPSocketAsync +Inherits URLConnection + #tag Event + Function AuthenticationRequested(realm As String, ByRef name As String, ByRef password As String) As Boolean + if RaiseEvent AuthenticationRequested( realm, name, password ) then + return true + end if + + if Username <> "" then + name = Username.ToText + password = self.Password.ToText + return true + else + return false + end if + End Function + #tag EndEvent + + #tag Event + Sub ContentReceived(URL As String, HTTPStatus As Integer, content As String) + url = Kaju.StripURLCredentials( url ) + + if not AllowRedirection and url <> RequestedURL then + content = "" + httpStatus = 302 + + elseif content.Encoding is nil and Encodings.UTF8.IsValidData( content ) then + content = content.DefineEncoding( Encodings.UTF8 ) + + end if + + RaiseEvent ContentReceived( url, httpStatus, content ) + End Sub + #tag EndEvent + + + #tag Method, Flags = &h0 + Sub Get(url As String, allowRedirect As Boolean) + self.AllowRedirection = allowRedirect + + Disconnect + + SetSecure url + super.Send "GET", url + End Sub + #tag EndMethod + + #tag Method, Flags = &h0 + Sub Get(url As String, file As FolderItem, allowRedirect As Boolean) + self.AllowRedirection = allowRedirect + + Disconnect + + SetSecure url + super.Send "GET", url, file + + End Sub + #tag EndMethod + + #tag Method, Flags = &h0 + Sub GetSync(url As String, file As FolderItem, timeout As Integer = 0) + self.AllowRedirection = true + + Disconnect + + SetSecure url + super.SendSync "GET", url, file, timeout + + End Sub + #tag EndMethod + + #tag Method, Flags = &h0 + Function GetSync(url As String, timeout As Integer = 0) As String + self.AllowRedirection = true + + Disconnect + + SetSecure url + return super.SendSync( "GET", url, timeout ) + End Function + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub Send(method As String, url As String, File As FolderItem) + super.Send Method, URL, File + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub Send(method as Text, url as Text) + super.Send method, url + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub SendSync(method As String, URL As String, file As FolderItem, timeout As Integer = 0) + super.SendSync method, URL, file, timeout + + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Function SendSync(method As String, URL As String, timeout As Integer = 0) As String + return super.SendSync( method, URL, timeout ) + + End Function + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub SetSecure(ByRef url As String) + AllowCertificateValidation = true + Username = "" + Password = "" + ClearRequestHeaders + + RequestHeader( "Cache-Control" ) = "private, no-cache, max-age=0" + RequestHeader( "Pragma" ) = "no-cache" + + url = url.ConvertEncoding( Encodings.UTF8 ) + RequestedURL = Kaju.StripURLCredentials( url ) + + #if not TargetMacOS then + + // + // See if the username and password has been specified + // + dim rx as new RegEx + rx.SearchPattern = "^(https?://)([^:/\x20@]+):([^:/\x20@]*)@(.*)" + + dim match as RegExMatch = rx.Search( url ) + if match isa RegExMatch then + Username = DecodeURLComponent( match.SubExpressionString( 2 ) ).DefineEncoding( Encodings.UTF8 ) + Password = DecodeURLComponent( match.SubExpressionString( 3 ) ).DefineEncoding( Encodings.UTF8 ) + url = match.SubExpressionString( 1 ) + match.SubExpressionString( 4 ) + url = url.DefineEncoding( Encodings.UTF8 ) + + // + // Set the request header manually + // + dim encoded as string = EncodeBase64( Username + ":" + Password ).DefineEncoding( Encodings.UTF8 ) + RequestHeader( "Authorization" ) = "Basic " + encoded.ToText + end if + + #endif + End Sub + #tag EndMethod + + + #tag Hook, Flags = &h0 + Event AuthenticationRequested(realm As String, ByRef name As String, ByRef password As String) As Boolean + #tag EndHook + + #tag Hook, Flags = &h0 + Event ContentReceived(url As String, httpStatus As Integer, content As String) + #tag EndHook + + + #tag Property, Flags = &h21 + Private AllowRedirection As Boolean = False + #tag EndProperty + + #tag Property, Flags = &h21 + Private Password As String + #tag EndProperty + + #tag Property, Flags = &h21 + Private RequestedURL As String + #tag EndProperty + + #tag Property, Flags = &h21 + Private Username As String + #tag EndProperty + + + #tag ViewBehavior + #tag ViewProperty + Name="AllowCertificateValidation" + Visible=false + Group="Behavior" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="HTTPStatusCode" + Visible=false + Group="Behavior" + InitialValue="" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Index" + Visible=true + Group="ID" + InitialValue="-2147483648" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Left" + Visible=true + Group="Position" + InitialValue="0" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Name" + Visible=true + Group="ID" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Super" + Visible=true + Group="ID" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Top" + Visible=true + Group="Position" + InitialValue="0" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag EndViewBehavior +End Class +#tag EndClass diff --git a/Kaju Classes/Kaju/Information.xojo_code b/Kaju Classes/Kaju/Information.xojo_code index 6097e7a..dce5980 100644 --- a/Kaju Classes/Kaju/Information.xojo_code +++ b/Kaju Classes/Kaju/Information.xojo_code @@ -132,7 +132,7 @@ Protected Class Information dim props() as Introspection.PropertyInfo = ti.GetProperties for each prop as Introspection.PropertyInfo in props - if prop.IsShared or prop.IsComputed or not prop.CanRead or not prop.CanWrite or not prop.IsPublic then + if prop.IsShared or not prop.CanRead or not prop.CanWrite or not prop.IsPublic then continue for prop end if @@ -203,11 +203,15 @@ Protected Class Information Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="IsValid" + Visible=false Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -215,18 +219,23 @@ Protected Class Information Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -234,6 +243,7 @@ Protected Class Information Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/Kaju/KajuException.xojo_code b/Kaju Classes/Kaju/KajuException.xojo_code index 4205df8..e8d69fd 100644 --- a/Kaju Classes/Kaju/KajuException.xojo_code +++ b/Kaju Classes/Kaju/KajuException.xojo_code @@ -35,9 +35,11 @@ Inherits RuntimeException #tag ViewBehavior #tag ViewProperty Name="ErrorNumber" + Visible=false Group="Behavior" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" @@ -45,6 +47,7 @@ Inherits RuntimeException Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -52,10 +55,13 @@ Inherits RuntimeException Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Message" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -63,18 +69,25 @@ Inherits RuntimeException Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Reason" + Visible=false Group="Behavior" + InitialValue="" Type="Text" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -82,6 +95,7 @@ Inherits RuntimeException Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/Kaju/UpdateChecker.xojo_code b/Kaju Classes/Kaju/UpdateChecker.xojo_code index e47d06f..7721a3c 100644 --- a/Kaju Classes/Kaju/UpdateChecker.xojo_code +++ b/Kaju Classes/Kaju/UpdateChecker.xojo_code @@ -1,5 +1,55 @@ #tag Class Protected Class UpdateChecker + #tag Method, Flags = &h21 + Private Sub AsyncHTTP_ContentReceived(sender As HTTPSocketAsync, url As String, httpStatus As Integer, content As String) + #pragma unused sender + #pragma unused url + + RemoveInstance self + + dim statusCode as integer = httpStatus + dim raw as string = content + + if statusCode >= 400 and statusCode <= 499 then // Not found + mResult = ResultType.PageNotFound + RaiseEvent ExecuteAsyncComplete + + elseif statusCode >= 300 and statusCode <= 399 then + mResult = ResultType.PageRedirected + RaiseEvent ExecuteAsyncComplete + + elseif ProcessRaw( raw ) then + FetchAsync true // Immediate because the socket is already set up + + else + RaiseEvent ExecuteAsyncComplete + + end if + + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub AsyncHTTP_Error(sender As HTTPSocketAsync, err As RuntimeException) + #pragma unused sender + + RemoveInstance self + + dim errMsg as string = err.Message + if errMsg = "" then + err.Message = "An exception of type " + Introspection.GetType( err ).Name + " has occurred" + end if + + LastError = err + + if HandleError( errMsg ) then + FetchAsync true // Immediate because the socket is already set up + else + RaiseEvent ExecuteAsyncComplete + end if + End Sub + #tag EndMethod + #tag Method, Flags = &h0 Sub Constructor(preferencesFolder As FolderItem, preferencesFilename As String = kDefaultPreferencesName) self.PrefFile = preferencesFolder.Child( preferencesFilename ) @@ -12,6 +62,15 @@ Protected Class UpdateChecker #tag Method, Flags = &h21 Private Sub Destructor() SavePrefs() + + TeardownAsyncHTTP + + if FetchAsyncTimer isa object then + FetchAsyncTimer.Mode = Timer.ModeOff + RemoveHandler FetchAsyncTimer.Action, WeakAddressOf FetchAsyncTimer_Action + FetchAsyncTimer = nil + end if + End Sub #tag EndMethod @@ -22,122 +81,150 @@ Protected Class UpdateChecker #tag EndMethod #tag Method, Flags = &h0 - Sub Execute() + Attributes( Deprecated = "ExecuteAsync" ) Sub Execute() // Pull the data from the URL, check it, and preset the window if needed // Returns true if the app should quit in preparation of the update. // // The caller should be prepared to handle an exception in case of error. - - // - // If there is already an update in progress, do nothing // - if UpdateWindowIsOpen then - mResult = ResultType.UpdateAlreadyInProgress - return - end if - // - // Make sure the OS is supported - // - if not OSIsSupported() then - mResult = ResultType.UnsupportedOS + if not PreCheck then return end if + FetchAndProcess + End Sub + #tag EndMethod + + #tag Method, Flags = &h0 + Sub ExecuteAsync() // - // Check for write permission + // Uses the new socket to check asynchronously + // (required for newer certificates) // - if true then // Scope - - dim executable as FolderItem = Kaju.TrueExecutableFile - - #if TargetMacOS then - if not executable.Parent.IsWriteable or not Kaju.IsWriteableRecursive( executable ) then - mResult = ResultType.NoWritePermission - return - end if - #else - if not Kaju.IsWriteableRecursive( executable.Parent ) then - mResult = ResultType.NoWritePermission - return - end if - #endif - - end if - - mDryRun = false - - // - // Make sure we have some URL + // The caller should be prepared to handle an exception in case of error. // - if UpdateURL.Trim = "" then - raise new KajuException( KajuException.kErrorMissingUpdateURL, CurrentMethodName ) + if not PreCheck then + return end if + FetchAsync false + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub FetchAndProcess() // // Look for redirection // dim url as string = self.UpdateURL - if AllowRedirection then - dim redirector as new Kaju.HTTPSSocket - url = redirector.GetRedirectAddress( url, 5 ) - end if // // Repeat the check until we get data or the user gives up // do + const kTimeout as integer = 5 - dim http as new Kaju.HTTPSSocket + dim raw as string + dim statusCode as integer - dim raw as string = http.Get( url, 5 ) - if http.HTTPStatusCode = 404 then // Not found - mResult = ResultType.NoUpdateAvailable + // + // Note: + // + // If Xojo ever disallows redirection in URLConnection + // we can delete HTTPSSocket and simplify this + // code. + // + if AllowRedirection then + dim http as new Kaju.HTTPSocketAsync // Follows redirects anyway + raw = http.GetSync( url, kTimeout ) + statusCode = http.HTTPStatusCode + else + dim http as new Kaju.HTTPSSocket + raw = http.Get( url, kTimeout ) // Does not follow redirects + statusCode = http.HTTPStatusCode + end if + + if statusCode = 404 then // Not found + mResult = ResultType.PageNotFound exit do - elseif raw = "" then - if HandleError( KajuLocale.kErrorNoUpdateData ) then - continue do - else - exit do - end if + elseif statusCode >= 300 and statusCode <= 399 then + mResult = ResultType.PageRedirected + exit do + end if + + if not ProcessRaw( raw ) then + exit do end if + loop + + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub FetchAsync(immediate As Boolean) + dim http as Kaju.HTTPSocketAsync = GetNewAsyncHTTPSocket // Set up the socket + + mResult = ResultType.FetchingUpdateInfo + + // + // We have to hold a reference to this object in case the consumer decided to use + // a temporary variable + // + StoreInstance self + + // + // If not immediate, start a timer to do this + // + // This is to counter a potential timing issue reported by a user + // so we set up the socket first, then call it later + // + if immediate then - raw = raw.DefineEncoding( Encodings.UTF8 ) + dim url as string = UpdateURL + http.Get url, AllowRedirection - dim firstLine as string - dim remainder as string - SeparatePacket( raw, firstLine, remainder ) - raw = remainder + // + // Processing will resume in the events + // - dim sig as string = firstLine.Left( kUpdatePacketMarker.Len ) - if StrComp( sig, kUpdatePacketMarker, 0 ) <> 0 then - if HandleError( KajuLocale.kErrorIncorrectPacketMarker ) then - continue do - else - exit do - end if - end if + else - sig = firstLine.Mid( sig.Len + 1 ) - sig = DecodeHex( sig ) - if not Crypto.RSAVerifySignature( raw, sig, ServerPublicRSAKey ) then - if HandleError( KajuLocale.kErrorIncorrectPacketSignature ) then - continue do - else - exit do - end if + if FetchAsyncTimer is nil then + FetchAsyncTimer = new Timer + FetchAsyncTimer.Period = 10 + AddHandler FetchAsyncTimer.Action, WeakAddressOf FetchAsyncTimer_Action end if - if ProcessUpdateData( raw ) then - exit do - end if - loop + FetchAsyncTimer.Mode = Timer.ModeSingle + + end if End Sub #tag EndMethod + #tag Method, Flags = &h21 + Private Sub FetchAsyncTimer_Action(sender As Timer) + #pragma unused sender + FetchAsync true + + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Function GetNewAsyncHTTPSocket() As Kaju.HTTPSocketAsync + TeardownAsyncHTTP + + AsyncHTTP = new HTTPSocketAsync + AddHandler AsyncHTTP.ContentReceived, WeakAddressOf AsyncHTTP_ContentReceived + AddHandler AsyncHTTP.Error, WeakAddressOf AsyncHTTP_Error + + return AsyncHTTP + End Function + #tag EndMethod + #tag Method, Flags = &h21 Private Function HandleError(msg As String) As Boolean // Displays a dialog to the user with the message and asks if they want to try again now or later @@ -255,34 +342,174 @@ Protected Class UpdateChecker Shared Function OSIsSupported() As Boolean // Ensures that the right tools are available on the current OS - dim r as boolean = true // Assume it's fine + dim errorCode as integer = 0 // Assume it's fine + dim errorMessage as string - #if TargetMacOS then - - r = true // If this app can run, it has the right tools - - #elseif TargetWindows then + // + // Try more than once, just in case + // + for repeatIndex as integer = 1 to 2 - dim sh as new Shell - sh.Execute "XCOPY /?" - r = sh.ErrorCode = 0 + #if TargetMacOS then + + errorCode = 0 // If this app can run, it has the right tools + errorMessage = "" + + #elseif TargetWindows then + + dim sh as new Shell + sh.TimeOut = 3000 + sh.Execute "XCOPY /?" + errorCode = sh.ErrorCode + if errorCode <> 0 then + errorMessage = sh.Result.Trim + end if + + #else // Linux + + dim cmds() as string = array( "rsync --version", "/usr/bin/logger --version" ) + + dim sh as new shell + for each cmd as string in cmds + sh.Execute cmd + errorCode = sh.ErrorCode + + if errorCode <> 0 then + errorMessage = "(" + cmd + ") " + sh.Result.Trim + exit for cmd + end if + next + + #endif - #else // Linux + if errorCode = 0 then + exit for repeatIndex + else + errorMessage = errorMessage.Trim + System.Log System.LogLevelCritical, _ + CurrentMethodName + ": Tool not available, code " + str( errorCode ) + _ + if( errorMessage <> "", ": " + errorMessage, "" ) + end if + next + + return errorCode = 0 + End Function + #tag EndMethod + + #tag Method, Flags = &h21 + Private Function Precheck() As Boolean + // + // If there is already an update in progress, do nothing + // + if UpdateWindowIsOpen then + mResult = ResultType.UpdateAlreadyInProgress + return false + end if + + // + // Clear the last error + // + LastError = nil + + // + // Make sure the OS is supported + // + if not OSIsSupported() then + mResult = ResultType.UnsupportedOS + return false + end if + + // + // Check for write permission + // + if true then // Scope - dim cmds() as string = array( "rsync --version", "/usr/bin/logger --version" ) + dim executable as FolderItem = Kaju.TrueExecutableFile - dim sh as new shell - for each cmd as string in cmds - sh.Execute cmd - if sh.ErrorCode <> 0 then - r = false - exit + #if TargetMacOS then + if not executable.Parent.IsWriteable or not Kaju.IsWriteableRecursive( executable ) then + mResult = ResultType.NoWritePermission + return false end if - next + #else + if not Kaju.IsWriteableRecursive( executable.Parent ) then + mResult = ResultType.NoWritePermission + return false + end if + #endif - #endif + end if - return r + mDryRun = false + + // + // Make sure we have some URL + // + + if UpdateURL.Trim = "" then + raise new KajuException( KajuException.kErrorMissingUpdateURL, CurrentMethodName ) + end if + + return true + End Function + #tag EndMethod + + #tag Method, Flags = &h21 + Private Function ProcessRaw(raw As String) As Boolean + // + // Processes the raw packet + // + // Returns True if the process should continue, False if it's done + // or was cancelled + // + + if raw = "" then + return HandleError( KajuLocale.kErrorNoUpdateData ) + end if + + raw = raw.DefineEncoding( Encodings.UTF8 ) + + dim firstLine as string + dim remainder as string + SeparatePacket( raw, firstLine, remainder ) + raw = remainder + + dim sig as string = firstLine.Left( kUpdatePacketMarker.Len ) + if StrComp( sig, kUpdatePacketMarker, 0 ) <> 0 then + return HandleError( KajuLocale.kErrorIncorrectPacketMarker ) + end if + + sig = firstLine.Mid( sig.Len + 1 ).Trim + sig = DecodeHex( sig ) + + // + // It's possible the EOL in the JSON got changed so we will try all + // possibilities before giving up + // + dim isValid as boolean + + dim eolChars() as string = array( "", &u0A, &u0D, &u0D + &u0A ) + for each eol as string in eolChars + dim tester as string = raw + if eol <> "" then + tester = ReplaceLineEndings( tester, eol ) + end if + + isValid = Crypto.RSAVerifySignature( tester, sig, ServerPublicRSAKey ) + if isValid then + exit for eol + end if + isValid = Crypto.RSAVerifySignature( tester.Trim, sig, ServerPublicRSAKey ) + if isValid then + exit for eol + end if + next + + if not isValid then + return HandleError( KajuLocale.kErrorIncorrectPacketSignature ) + end if + + return not ProcessUpdateData( raw ) End Function #tag EndMethod @@ -302,7 +529,8 @@ Protected Class UpdateChecker dim info() as Kaju.UpdateInformation dim updateIsRequired as boolean for i as integer = 0 to ub - dim thisInfo as new Kaju.UpdateInformation( j( i ) ) + dim thisElement as JSONItem = j( i ) + dim thisInfo as new Kaju.UpdateInformation( thisElement ) // // See if the binary information is present @@ -380,17 +608,20 @@ Protected Class UpdateChecker End Function #tag EndMethod - #tag Method, Flags = &h0 - Sub ResetIgnored() - redim IgnoreVersionsPref( -1 ) + #tag Method, Flags = &h21 + Private Shared Sub RemoveInstance(o As UpdateChecker) + dim i as integer = AsyncCheckers.IndexOf( o ) + if i <> -1 then + AsyncCheckers.Remove i + end if + End Sub #tag EndMethod #tag Method, Flags = &h0 - Function Result() As ResultType - return mResult - - End Function + Sub ResetIgnored() + redim IgnoreVersionsPref( -1 ) + End Sub #tag EndMethod #tag Method, Flags = &h21 @@ -454,6 +685,15 @@ Protected Class UpdateChecker End Sub #tag EndMethod + #tag Method, Flags = &h21 + Private Shared Sub StoreInstance(o As UpdateChecker) + if AsyncCheckers.IndexOf( o ) = -1 then + AsyncCheckers.Append o + end if + + End Sub + #tag EndMethod + #tag Method, Flags = &h21 Private Function StringArrayToJSON(arr() As String) As JSONItem dim j as new JSONItem( "[]" ) @@ -465,6 +705,17 @@ Protected Class UpdateChecker End Function #tag EndMethod + #tag Method, Flags = &h21 + Private Sub TeardownAsyncHTTP() + if AsyncHTTP isa object then + RemoveHandler AsyncHTTP.ContentReceived, WeakAddressOf AsyncHTTP_ContentReceived + RemoveHandler AsyncHTTP.Error, WeakAddressOf AsyncHTTP_Error + AsyncHTTP = nil + end if + + End Sub + #tag EndMethod + #tag Method, Flags = &h0 Sub TestUpdate(jsonString As String) // Allows a dry run with the update information that would otherwise be obtained @@ -491,11 +742,7 @@ Protected Class UpdateChecker #tag Hook, Flags = &h0 - Event ReadyToInstall() - #tag EndHook - - #tag Hook, Flags = &h0 - Event RequiredUpdateDeclined() + Event ExecuteAsyncComplete() #tag EndHook @@ -515,6 +762,14 @@ Protected Class UpdateChecker AllowRedirection As Boolean = False #tag EndProperty + #tag Property, Flags = &h21 + Private Shared AsyncCheckers() As Kaju.UpdateChecker + #tag EndProperty + + #tag Property, Flags = &h21 + Private AsyncHTTP As Kaju.HTTPSocketAsync + #tag EndProperty + #tag Property, Flags = &h0 DefaultImage As Picture #tag EndProperty @@ -523,6 +778,10 @@ Protected Class UpdateChecker DefaultUseTransparency As Boolean = True #tag EndProperty + #tag Property, Flags = &h21 + Private FetchAsyncTimer As Timer + #tag EndProperty + #tag Property, Flags = &h0 HonorIgnored As Boolean = True #tag EndProperty @@ -531,12 +790,16 @@ Protected Class UpdateChecker Private IgnoreVersionsPref() As String #tag EndProperty + #tag Property, Flags = &h0 + LastError As RuntimeException + #tag EndProperty + #tag Property, Flags = &h21 Private mDryRun As Boolean #tag EndProperty #tag Property, Flags = &h21 - Private mResult As ResultType = ResultType.NotYetChecked + Attributes( hidden ) Private mResult As ResultType = ResultType.NotYetChecked #tag EndProperty #tag Property, Flags = &h21 @@ -547,6 +810,15 @@ Protected Class UpdateChecker QuitOnCancelIfRequired As Boolean = True #tag EndProperty + #tag ComputedProperty, Flags = &h0 + #tag Getter + Get + return mResult + End Get + #tag EndGetter + Result As ResultType + #tag EndComputedProperty + #tag Property, Flags = &h0 ServerPublicRSAKey As String #tag EndProperty @@ -600,51 +872,69 @@ Protected Class UpdateChecker NoUpdateAvailable = 0 IgnoredUpdateAvailable UpdateAvailable - RequiredUpdateAvailable + RequiredUpdateAvailable + FetchingUpdateInfo + PageRedirected = 302 + PageNotFound = 404 #tag EndEnum #tag ViewBehavior #tag ViewProperty Name="Allow32bitTo64bitUpdates" + Visible=false Group="Behavior" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="AllowedInteraction" + Visible=false Group="Behavior" InitialValue="kAllowAll" Type="UInt32" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="AllowedStage" + Visible=false Group="Behavior" InitialValue="App.Development" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="AllowRedirection" + Visible=false Group="Behavior" InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="DefaultImage" + Visible=false Group="Behavior" + InitialValue="" Type="Picture" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="DefaultUseTransparency" + Visible=false Group="Behavior" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="HonorIgnored" + Visible=false Group="Behavior" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" @@ -652,6 +942,7 @@ Protected Class UpdateChecker Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -659,22 +950,29 @@ Protected Class UpdateChecker Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="QuitOnCancelIfRequired" + Visible=false Group="Behavior" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="ServerPublicRSAKey" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -682,7 +980,9 @@ Protected Class UpdateChecker Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -690,17 +990,45 @@ Protected Class UpdateChecker Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="UpdateURL" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="UpdateWindowIsOpen" + Visible=false Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Result" + Visible=false + Group="Behavior" + InitialValue="" + Type="ResultType" + EditorType="Enum" + #tag EnumValues + "-9999 - NotYetChecked" + "-100 - UpdateAlreadyInProgress" + "-70 - UnsupportedOS" + "-50 - NoWritePermission" + "-1 - Error" + "0 - NoUpdateAvailable" + "1 - IgnoredUpdateAvailable" + "2 - UpdateAvailable" + "3 - RequiredUpdateAvailable" + "4 - FetchingUpdateInfo" + "302 - PageRedirected" + "404 - PageNotFound" + #tag EndEnumValues #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/Kaju/UpdateInformation.xojo_code b/Kaju Classes/Kaju/UpdateInformation.xojo_code index 94a2248..0a6471b 100644 --- a/Kaju Classes/Kaju/UpdateInformation.xojo_code +++ b/Kaju Classes/Kaju/UpdateInformation.xojo_code @@ -115,6 +115,13 @@ Inherits Kaju.Information Function ConvertToJSON() As JSONItem dim j as JSONItem = super.ConvertToJSON + // + // Add a security token + // + dim rawKey as string = Crypto.GenerateRandomBytes( 8 ) + dim encodedKey as string = EncodeBase64( rawKey, 0 ) + j.Value( Kaju.kNameSecurityToken ) = encodedKey + for each binaryName as string in BinaryNames dim b as Kaju.BinaryInformation = Binaries.Lookup( binaryName, nil ) if b isa Kaju.BinaryInformation then @@ -126,6 +133,24 @@ Inherits Kaju.Information End Function #tag EndMethod + #tag Method, Flags = &h21 + Private Sub Destructor() + #if not TargetConsole then + if ImageSocket isa object then + ImageSocket.Disconnect + RemoveHandler ImageSocket.ContentReceived, WeakAddressOf ImageSocket_ContentReceived + ImageSocket = nil + end if + + if ReleaseNotesSocket isa object then + ReleaseNotesSocket.Disconnect + RemoveHandler ReleaseNotesSocket.ContentReceived, WeakAddressOf ReleaseNotesSocket_ContentReceived + ReleaseNotesSocket = nil + end if + #endif + End Sub + #tag EndMethod + #tag Method, Flags = &h0 Function FetchBinary(binaryName As String) As Kaju.BinaryInformation dim binary as Kaju.BinaryInformation = Binaries.Lookup( binaryName, nil ) @@ -147,6 +172,75 @@ Inherits Kaju.Information End Function #tag EndMethod + #tag Method, Flags = &h21, CompatibilityFlags = (TargetWeb and (Target32Bit or Target64Bit)) or (TargetDesktop and (Target32Bit or Target64Bit)) or (TargetIOS and (Target32Bit or Target64Bit)) + Private Sub ImageSocket_ContentReceived(sender As Kaju.HTTPSocketAsync, url As String, httpStatus As Integer, content As String) + #pragma unused sender + #pragma unused url + + if httpStatus <> 404 and content <> "" then + dim p as Picture = Picture.FromData( content ) + + if ImageScale > 1 then + p = new Picture( p.Width \ ImageScale, p.Height \ ImageScale, array( p ) ) + end if + + mImage = p + RaiseEvent ImageReceived + end if + + End Sub + #tag EndMethod + + #tag Method, Flags = &h21, CompatibilityFlags = (TargetWeb and (Target32Bit or Target64Bit)) or (TargetDesktop and (Target32Bit or Target64Bit)) or (TargetIOS and (Target32Bit or Target64Bit)) + Private Sub ReleaseNotesSocket_ContentReceived(sender As Kaju.HTTPSocketAsync, url As String, httpStatus As Integer, content As String) + #pragma unused sender + #pragma unused url + + dim raw as string = content + + if httpStatus = 404 or raw.Trim = "" then + // + // Do nothing + // + + else + // + // Adjust the encoding + // + + dim enc as TextEncoding + + // + // See if the html contains a charset + // + static rxCharSetFinder as RegEx + if rxCharSetFinder is nil then + rxCharSetFinder = new RegEx + rxCharSetFinder.SearchPattern = " "" then + mReleaseNotesFromURL = raw + RaiseEvent ReleaseNotesReceived() + end if + end if + + End Sub + #tag EndMethod + #tag Method, Flags = &h0 Sub RemoveBinary(binaryName As String) if Binaries.HasKey( binaryName ) then @@ -172,10 +266,33 @@ Inherits Kaju.Information #tag EndMethod + #tag Hook, Flags = &h0 + Event ImageReceived() + #tag EndHook + + #tag Hook, Flags = &h0 + Event ReleaseNotesReceived() + #tag EndHook + + #tag Property, Flags = &h0 AppName As String #tag EndProperty + #tag ComputedProperty, Flags = &h0 + #tag Getter + Get + if mReleaseNotesFromURL <> "" then + return mReleaseNotesFromURL + else + return mReleaseNotes + end if + + End Get + #tag EndGetter + DisplayReleaseNotes As String + #tag EndComputedProperty + #tag ComputedProperty, Flags = &h0, CompatibilityFlags = (TargetHasGUI) #tag Getter Get @@ -193,16 +310,14 @@ Inherits Kaju.Information // Get the image // - dim http as new Kaju.HTTPSSocket - url = http.GetRedirectAddress( url, 5 ) - - dim data as string = http.Get( url, 5 ) - - if data = "" then - return nil + if ImageSocket is nil then + ImageSocket = new Kaju.HTTPSocketAsync + AddHandler ImageSocket.ContentReceived, WeakAddressOf ImageSocket_ContentReceived end if - mImage = Picture.FromData( data ) + dim http as Kaju.HTTPSocketAsync = ImageSocket + + http.Get( url, true ) Exception err as RuntimeException mImage = nil @@ -215,6 +330,14 @@ Inherits Kaju.Information Image As Picture #tag EndComputedProperty + #tag Property, Flags = &h0 + ImageScale As Integer = 1 + #tag EndProperty + + #tag Property, Flags = &h21, CompatibilityFlags = (TargetWeb and (Target32Bit or Target64Bit)) or (TargetDesktop and (Target32Bit or Target64Bit)) or (TargetIOS and (Target32Bit or Target64Bit)) + Private ImageSocket As Kaju.HTTPSocketAsync + #tag EndProperty + #tag Property, Flags = &h0 ImageURL As String #tag EndProperty @@ -231,6 +354,14 @@ Inherits Kaju.Information MinimumRequiredVersion As String #tag EndProperty + #tag Property, Flags = &h21 + Private mReleaseNotes As String + #tag EndProperty + + #tag Property, Flags = &h21 + Private mReleaseNotesFromURL As String + #tag EndProperty + #tag ComputedProperty, Flags = &h0 #tag Getter Get @@ -341,8 +472,93 @@ Inherits Kaju.Information Private Shared PropInfoDictionary As Dictionary #tag EndComputedProperty - #tag Property, Flags = &h0 + #tag ComputedProperty, Flags = &h0 + #tag Getter + Get + return mReleaseNotes + + End Get + #tag EndGetter + #tag Setter + Set + mReleaseNotes = value + + // + // The release notes might be straight HTML or them might be a URL. + // If the latter, the remainder will be alternate notes. + // This method will determine which it is and, if the latter, will + // attempt to fetch the notes. If it can't, it will return the alternate + // notes if any, or a message. + // + // The URL may start the first line followed by an EOL or may be in an + // HTML comment that starts the first line. The latter form will maintain + // better compatibility with previous versions of Kaju. + // + // Examples: + // + // http://something.com/UpdateInformation.json + // + // + // + // + // + + mReleaseNotesFromURL = "" + + static noInfoHTML as string = "" + KajuLocale.kNoUpdateInfoMessage + "" + + static rxURLSplitter as RegEx + if rxURLSplitter is nil then + rxURLSplitter = new RegEx + rxURLSplitter.SearchPattern = _ + "(?mi-Us)\A\x20*(?|(?:(http[^\s]+)\x20*\R)|(?:))([\s\S]*)" + end if + + dim r as string = value + + #if not TargetConsole then + + dim matchURL as RegExMatch = rxURLSplitter.Search( value) + if matchURL isa RegExMatch then + dim url as string = matchURL.SubExpressionString( 1 ).Trim + dim alternateNotes as string = matchURL.SubExpressionString( 2 ).Trim + + if ReleaseNotesSocket is nil then + ReleaseNotesSocket = new Kaju.HTTPSocketAsync + AddHandler ReleaseNotesSocket.ContentReceived, WeakAddressOf ReleaseNotesSocket_ContentReceived + end if + + dim http as Kaju.HTTPSocketAsync = ReleaseNotesSocket + http.Get url, true + mReleaseNotes = alternateNotes + end if + + #endif + + if r.Trim = "" then + r = noInfoHTML + end if + + mReleaseNotes = r + + End Set + #tag EndSetter ReleaseNotes As String + #tag EndComputedProperty + + #tag ComputedProperty, Flags = &h0 + #tag Getter + Get + Return mReleaseNotesFromURL + End Get + #tag EndGetter + ReleaseNotesFromURL As String + #tag EndComputedProperty + + #tag Property, Flags = &h21, CompatibilityFlags = (TargetWeb and (Target32Bit or Target64Bit)) or (TargetDesktop and (Target32Bit or Target64Bit)) or (TargetIOS and (Target32Bit or Target64Bit)) + Private ReleaseNotesSocket As Kaju.HTTPSocketAsync #tag EndProperty #tag Property, Flags = &h0 @@ -426,18 +642,25 @@ Inherits Kaju.Information #tag ViewBehavior #tag ViewProperty Name="AppName" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Image" + Visible=false Group="Behavior" + InitialValue="" Type="Picture" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="ImageURL" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -447,11 +670,15 @@ Inherits Kaju.Information Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="IsValid" + Visible=false Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -459,10 +686,13 @@ Inherits Kaju.Information Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="MinimumRequiredVersion" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -470,29 +700,33 @@ Inherits Kaju.Information Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - #tag EndViewProperty - #tag ViewProperty - Name="ReleaseNotes" - Group="Behavior" - Type="String" - EditorType="MultiLineEditor" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="RequiresPayment" + Visible=false Group="Behavior" + InitialValue="" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="StageCode" + Visible=false Group="Behavior" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -500,23 +734,63 @@ Inherits Kaju.Information Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="UseTransparency" + Visible=false Group="Behavior" InitialValue="True" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Version" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="VersionAsDouble" + Visible=false Group="Behavior" + InitialValue="" Type="Double" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="ReleaseNotes" + Visible=false + Group="Behavior" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="ImageScale" + Visible=false + Group="Behavior" + InitialValue="1" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="ReleaseNotesFromURL" + Visible=false + Group="Behavior" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" + #tag EndViewProperty + #tag ViewProperty + Name="DisplayReleaseNotes" + Visible=false + Group="Behavior" + InitialValue="" + Type="String" + EditorType="MultiLineEditor" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/Kaju/UpdateInitiater.xojo_code b/Kaju Classes/Kaju/UpdateInitiater.xojo_code index f8728f0..3179a9a 100644 --- a/Kaju Classes/Kaju/UpdateInitiater.xojo_code +++ b/Kaju Classes/Kaju/UpdateInitiater.xojo_code @@ -366,14 +366,22 @@ Protected Class UpdateInitiater dim scriptFile as FolderItem = tempFolder.Child( scriptName ) dim bs as BinaryStream = BinaryStream.Create( scriptFile, true ) bs.Write( script ) - if bs.LastErrorCode <> 0 then - MsgBox "Error writing script file: " + str( bs.LastErrorCode ) - scriptFile = nil - end if + #if XojoVersion < 2019.02 + if bs.LastErrorCode <> 0 then + dim ex as new IOException + ex.ErrorNumber = bs.LastErrorCode + raise ex + end if + #endif bs.Close bs = nil return scriptFile + + exception err as IOException + MsgBox "Error writing script file: " + str( err.ErrorNumber ) + return nil + End Function #tag EndMethod @@ -485,7 +493,7 @@ Protected Class UpdateInitiater #tag Constant, Name = kUpdaterScript, Type = String, Dynamic = False, Default = \"", Scope = Private #Tag Instance, Platform = Mac OS, Language = Default, Definition = \"#!/bin/bash\n\n#\n# FUNCTIONS\n#\n\nfunction log_cmd {\n /usr/bin/logger -t \"Kaju Update Script\" $@\n}\n\n# END FUNCTIONS\n\n#\n# These will be filled in by the calling app\n#\n\nAPP_NAME\x3D@@APP_NAME@@\nAPP_PARENT\x3D@@APP_PARENT@@\nAPP_VERSION\x3D@@APP_VERSION@@\nNEW_APP_NAME\x3D@@NEW_APP_NAME@@\nNEW_APP_PARENT\x3D@@NEW_APP_PARENT@@\nTEMP_FOLDER_PATH\x3D@@TEMP_FOLDER@@\nPID_FILE\x3D@@PID_FILE_PATH@@\n\n#\n# -----------------\n#\n\nreadonly true\x3D1\nreadonly false\x3D0\n\nAPP_PATH\x3D$APP_PARENT/$APP_NAME\nNEW_APP_PATH\x3D$NEW_APP_PARENT/$NEW_APP_NAME\n\nRENAMED_APP_NAME\x3D`echo \"$APP_NAME\" | /usr/bin/sed -E s/\\.[aA][pP]{2}//`-`date +%Y%m%d%H%M%S`.app\nRENAMED_APP_PATH\x3D$APP_PARENT/$RENAMED_APP_NAME\n\nlog_cmd \"STARTING UPDATE OF $APP_NAME\"\n\ncounter\x3D10\nwhile [ -f \"$PID_FILE\" ]\ndo\n log_cmd \"Checking to see if $PIDFILE exists\x2C $counter\"\n sleep 1\n \n let counter\x3Dcounter-1\n \n if [ $counter \x3D\x3D 0 ]\n then\n \tlog_cmd \'ERROR: Could not update app\x2C it never quit\'\n \texit 1\n fi\ndone\n\nPROCEED\x3D$true\n\n#\n# Rename the old application\n#\nlog_cmd \"Renaming old application $APP_NAME to $RENAMED_APP_NAME\"\nmv \"$APP_PATH\" \"$RENAMED_APP_PATH\"\n\n#\n# Make sure that succeeded\n#\nif [ $\? \x3D\x3D 0 ]\nthen\n log_cmd \'...confirmed\'\nelse\n log_cmd \"Could not rename old application to $RENAMED_APP_PATH\"\n PROCEED\x3D0\nfi\n\n#\n# Move in the replacement app\n#\nif [ $PROCEED \x3D\x3D $true ]\nthen\n log_cmd \"Moving new application $NEW_APP_PATH to folder $APP_PARENT\"\n mv \"$NEW_APP_PATH\" \"$APP_PARENT\"\n\n #\n # Make sure that worked\n #\n if [ $\? \x3D\x3D 0 ]\n then\n log_cmd \'...confirmed\'\n else\n log_cmd \"Could not move in new application\"\n log_cmd \"Attempting to restore old application and launch it\"\n mv \"$RENAMED_APP_PATH\" \"$APP_PATH\"\n open \"$APP_PATH\" --args --kaju-fail\n PROCEED\x3D$false\n fi\nfi\n\nif [ $PROCEED \x3D\x3D $true ]\nthen\n log_cmd \"Removing old application $RENAMED_APP_NAME\"\n rm -fr \"$RENAMED_APP_PATH\"\n \n APP_PATH\x3D$APP_PARENT/$NEW_APP_NAME\n log_cmd \"Starting new application at $APP_PATH\"\n \n open \"$APP_PATH\" --args --kaju-success \"$APP_VERSION\"\nfi\n\nif [ $PROCEED \x3D\x3D $true ]\nthen\n log_cmd \'Removing temp folder\'\n rm -fr \"$TEMP_FOLDER_PATH\"\nfi\n" #Tag Instance, Platform = Linux, Language = Default, Definition = \"#!/bin/bash\n\n#\n# FUNCTIONS\n#\n\nfunction log_cmd {\n\t/usr/bin/logger -t \"Kaju Update Script\" $@\n}\n\n# END FUNCTIONS\n\n#\n# These will be filled in by the calling app\n#\n\nAPP_NAME\x3D@@APP_NAME@@\nAPP_PARENT\x3D@@APP_PARENT@@\nAPP_VERSION\x3D@@APP_VERSION@@\nNEW_APP_NAME\x3D@@NEW_APP_NAME@@\nNEW_APP_PARENT\x3D@@NEW_APP_PARENT@@\nTEMP_FOLDER_PATH\x3D@@TEMP_FOLDER@@\nPID_FILE\x3D@@PID_FILE_PATH@@\n\n#\n# This array will store the names of the items next to the executable\n# under the variable NEW_APP_OTHER_NAME\n#\nNEW_APP_OTHER_UB\x3D@@NEW_APP_OTHER_UB@@\n\n@@NEW_APP_OTHER_ARRAY@@\n\n#\n# -----------------\n#\n\nreadonly true\x3D1\nreadonly false\x3D0\n\nAPP_PATH\x3D$APP_PARENT/$APP_NAME\n\nBACKUP_PARENT\x3D$APP_PARENT/${APP_NAME}-`date +%Y%m%d%H%M%S`\nmkdir \"$BACKUP_PARENT\"\n\nlog_cmd \"STARTING UPDATE OF $APP_NAME\"\n\ncounter\x3D10\nwhile [ -f \"$PID_FILE\" ]\ndo\n\tlog_cmd \"Checking to see if $PIDFILE exists\x2C $counter\"\n\tsleep 1\n\t\n\tlet counter\x3Dcounter-1\n\t\n\tif [ $counter \x3D\x3D 0 ]\n\tthen\n\t\tlog_cmd \'ERROR: Could not update app\x2C it never quit\'\n\t\texit 1\n\tfi\ndone\n\nPROCEED\x3D$true\n\n#\n# Move the other items\n#\nlog_cmd \"Copying other items to backup $BACKUP_PARENT\"\n\ncounter\x3D0\nwhile [ $counter -le $NEW_APP_OTHER_UB ]\ndo\n\tthis_item\x3D${NEW_APP_OTHER_NAME[$counter]}\n\tlog_cmd \"Looking for item $this_item in $APP_PARENT\"\n\t\n\tthis_path\x3D$APP_PARENT/$this_item\n\tif [ -d \"$this_path\" ] || [ -f \"$this_path\" ]\n\tthen\n\t\tlog_cmd \"...found\x2C copying\"\n\t\tcp -pr \"$this_path\" \"$BACKUP_PARENT\"\n\t\tif [ $\? \x3D\x3D 0 ]\n\t\tthen\n\t\t\tlog_cmd \"...confirmed\"\n\t\telse\n\t\t\t log_cmd \"...FAILED!\"\n\t\t\t PROCEED\x3D$false\n\t\t\t break\n\t\tfi\n\tfi\n\t(( counter++ ))\ndone\n\n#\n# Move the executable\n#\nif [ $PROCEED \x3D\x3D $true ]\nthen\n\tlog_cmd \"Moving the executable $APP_NAME to backup\"\n\tmv \"$APP_PARENT/$APP_NAME\" \"$BACKUP_PARENT\"\n\tif [ $\? \x3D\x3D 0 ]\n\tthen\n\t\tlog_cmd \"...confirmed\"\n\telse\n\t\tlog_cmd \"...FAILED! (Error $\?)\"\n\t\tPROCEED\x3D$false\n\tfi\nfi\n\n#\n# Make sure there wasn\'t an error during the backup\n#\nif [ $PROCEED \x3D\x3D $true ]\nthen\n\tlog_cmd \'All items backed up\'\nelse\n\tlog_cmd \'Attempting to copy items back to parent\'\n\trsync -a --exclude\x3D\'.DS_Store\' \"${BACKUP_PARENT}/\" \"$APP_PARENT\"\nfi\n\n#\n# Move in the replacement files\n#\nif [ $PROCEED \x3D\x3D $true ]\nthen\n\tlog_cmd \"Copying files from $NEW_APP_PARENT to folder $APP_PARENT\"\n\trsync -a --exclude\x3D\'.DS_Store\' \"${NEW_APP_PARENT}/\" \"$APP_PARENT\"\n\t\n\tif [ $\? \x3D\x3D 0 ]\n\tthen\n\t\tlog_cmd \'...confirmed\'\n\telse\n\t\tlog_cmd \"...FAILED! (Error $\?)\"\n\t\tlog_cmd \"Attempting to restore old application\"\n\t\trsync -a --exclude\x3D\'.DS_Store\' \"${BACKUP_PARENT}/\" \"$APP_PARENT\"\n\t\tPROCEED\x3D$false\n\t\tbreak\n\tfi\nfi\n\n#\n# Removed the backup folder if everything has gone swimmingly so\n#\nif [ $PROCEED \x3D\x3D $true ]\nthen\n\tlog_cmd \'Removing backup\'\n\trm -r \"$BACKUP_PARENT\"\nfi\n\n#\n# Launch the application\n#\nif [ $PROCEED \x3D $true ]\nthen\n\tlog_cmd \'Making the new app executable\'\n\tchmod +x \"$APP_PARENT/$NEW_APP_NAME\"\n\tlog_cmd \'Launching new app\'\n\t\"$APP_PARENT/$NEW_APP_NAME\" --kaju-success \"$APP_VERSION\"\nelse\n\tlog_cmd \'Launching old app\'\n\t\"$APP_PARENT/$APP_NAME\" --kaju-fail\nfi\n\nlog_cmd \'Removing temp folder\'\nrm -fr \"$TEMP_FOLDER_PATH\"\n" - #Tag Instance, Platform = Windows, Language = Default, Definition = \"@ECHO OFF \n\nREM\nREM These will be filled in by the calling app\nREM\n\nSET APP_NAME\x3D@@APP_NAME@@\nSET APP_PARENT\x3D@@APP_PARENT@@\nSET APP_VERSION\x3D@@APP_VERSION@@\nSET NEW_APP_NAME\x3D@@NEW_APP_NAME@@\nSET NEW_APP_PARENT\x3D@@NEW_APP_PARENT@@\nSET TEMP_FOLDER_PATH\x3D@@TEMP_FOLDER@@\nSET DECOMPRESSED_FOLDER_PATH\x3D@@DECOMPRESSED_FOLDER@@\nSET PID_FILE\x3D@@PID_FILE_PATH@@\n\nREM\nREM -----------------\nREM\n\nSET TODAY_DATE\x3D%DATE:~10\x2C4%-%DATE:~4\x2C2%-%DATE:~7\x2C2% %TIME:~0\x2C2%:%TIME:~3\x2C2%:%TIME:~6\x2C2%\nSET APP_PATH\x3D%APP_PARENT%\\%APP_NAME%\n\nSET BACKUP_PARENT\x3D%APP_PATH%-%DATE:~10\x2C4%%DATE:~4\x2C2%%DATE:~7\x2C2%%TIME:~0\x2C2%%TIME:~3\x2C2%%TIME:~6\x2C2%\n\nSET LOGGER\x3D%APP_PARENT%\\%NEW_APP_NAME% Update Log.txt\nECHO \"STARTED ON %TODAY_DATE%\" >> \"%LOGGER%\" 2>&1\n\nFOR /L %%i IN (1\x2C1\x2C10) DO (\n\tIF NOT EXIST \"%PID_FILE%\" (\n\t\tGOTO :program_exited\n\t)\n\n\tREM Windows version of sleep 1. Starting in Windows Vista\x2C the sleep command was removed.\n\tping -n 2 127.0.0.1 >nul\n\n\tIF %%i \x3D\x3D 10 (\n\t\tECHO ERROR: Could not update app\x2C it never quit >> \"%LOGGER%\" 2>&1\n\t\tEXIT /B 1\n\t)\n)\n:program_exited\n\nmkdir \"%BACKUP_PARENT%\"\n\nSET PROCEED\x3D1\n\nREM\nREM Move the other items\nREM\nECHO \"Copying items to backup %BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\nREM We will need to manually populate these move commands. Windows Batch doesn\'t really handle arrays\x2C\nREM only looping through space delimited elements of a string. Below is a template for moving one such file.\n\nREM BEGIN PSEUDO-ARRAY\nSET THIS_ITEM\x3D@@OTHER_NAME@@\nSET THIS_PATH\x3D%APP_PARENT%\\%THIS_ITEM%\nECHO \"Looking for item %THIS_PATH%\" >> \"%LOGGER%\" 2>&1\nIF EXIST \"%THIS_PATH%\" (\n\tGOTO :copy_@@OTHER_NAME_WO_SPACES@@\n)\nECHO \"...not found as file\x2C trying as directory\" >> \"%LOGGER%\" 2>&1\nIF EXIST \"%THIS_PATH%\\NUL\" (\n\tGOTO :copy_@@OTHER_NAME_WO_SPACES@@\n) ELSE (\n\tECHO \"...NOT FOUND!\" >> \"%LOGGER%\" 2>&1\n\tGOTO :finished_with_@@OTHER_NAME_WO_SPACES@@\n)\n\n:copy_@@OTHER_NAME_WO_SPACES@@\n\nECHO \"...found\x2C copying\" >> \"%LOGGER%\" 2>&1\nCOPY \"%THIS_PATH%\" \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\nIF %ERRORLEVEL% NEQ 0 (\n\tECHO \"...FAILED! (Error %ERRORLEVEL%)\" >> \"%LOGGER%\" 2>&1\n\tSET PROCEED\x3D0\n\tGOTO :restore_from_backup\n) ELSE (\n\tECHO \"...confirmed\" >> \"%LOGGER%\" 2>&1\n)\n\n:finished_with_@@OTHER_NAME_WO_SPACES@@\n\nREM END PSEUDO-ARRAY\n\nREM\nREM Move the executable to backup\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Moving the executable %APP_NAME% to backup\" >> \"%LOGGER%\" 2>&1\n\tMOVE \"%APP_PATH%\" \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tIF %ERRORLEVEL% NEQ 0 (\n\t\tECHO \"...FAILED! (Error %ERRORLEVEL%)\" >> \"%LOGGER%\" 2>&1\n\t\tSET PROCEED\x3D0\n\t\tGOTO :restore_from_backup\n\t) ELSE (\n\t\tECHO \"...confirmed\" >> \"%LOGGER%\" 2>&1\n\t)\n)\n\nREM\nREM Make sure there wasn\'t an error during the move\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"All items moved to backup\" >> \"%LOGGER%\" 2>&1\n)\n\nREM\nREM Copy in the replacement files\nREM\n\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Copying files from %NEW_APP_PARENT% to folder %APP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tXCOPY /g /y /e /k \"%NEW_APP_PARENT%\" \"%APP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tIF %ERRORLEVEL% NEQ 0 (\n\t\tECHO \"...FAILED! (Error %ERRORLEVEL%)\" >> \"%LOGGER%\" 2>&1\n\t\tSET PROCEED\x3D0\n\t\tGOTO :restore_from_backup\n\t) ELSE (\n\t\tECHO \"...confirmed\" >> \"%LOGGER%\" 2>&1\n\t)\n)\n\nREM\nREM If we get here\x2C it all worked\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tGOTO :all_succeeded\n)\n\n:restore_from_backup\nIF %PROCEED% \x3D\x3D 0 (\n\tECHO \"Attempting to restore old application\" >> \"%LOGGER%\" 2>&1\n\n\tXCOPY /g /y /e /k \"%BACKUP_PARENT%\" \"%APP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tIF %ERRORLEVEL% EQU 0 (\n\t\tRMDIR /S /Q \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\t)\n)\nGOTO :launch_application\n\n:all_succeeded\nREM\nREM Remove the backup and decompressed folders if everything has gone swimmingly so far\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Removing backup\" >> \"%LOGGER%\" 2>&1\n\tRMDIR /S /Q \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tECHO \"Removing decompressed folder\" >> \"%LOGGER%\" 2>&1\n\tRMDIR /S /Q \"%DECOMPRESSED_FOLDER_PATH%\" >> \"%LOGGER%\" 2>&1\n)\n\nREM\nREM Launch the application\nREM\n:launch_application\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Launching new app\" >> \"%LOGGER%\" 2>&1\n\tSTART \"\" \"%APP_PARENT%\\%NEW_APP_NAME%\" --kaju-success %APP_VERSION%\n\tGOTO :remove_backup_folder\n) ELSE (\n\tECHO \"Launching old app\" >> \"%LOGGER%\" 2>&1\n\tSTART \"\" \"%APP_PATH%\" --kaju-fail\n)\n\n:remove_backup_folder\nECHO \"Removing temp folder\" >> \"%LOGGER%\" 2>&1\nRMDIR /S /Q \"%TEMP_FOLDER_PATH%\" >> \"%LOGGER%\" 2>&1\n" + #Tag Instance, Platform = Windows, Language = Default, Definition = \"@ECHO OFF \n\nREM\nREM These will be filled in by the calling app\nREM\n\nSET APP_NAME\x3D@@APP_NAME@@\nSET APP_PARENT\x3D@@APP_PARENT@@\nSET APP_VERSION\x3D@@APP_VERSION@@\nSET NEW_APP_NAME\x3D@@NEW_APP_NAME@@\nSET NEW_APP_PARENT\x3D@@NEW_APP_PARENT@@\nSET TEMP_FOLDER_PATH\x3D@@TEMP_FOLDER@@\nSET DECOMPRESSED_FOLDER_PATH\x3D@@DECOMPRESSED_FOLDER@@\nSET PID_FILE\x3D@@PID_FILE_PATH@@\n\nREM\nREM -----------------\nREM\n\nSET TODAY_DATE\x3D%DATE:~10\x2C4%-%DATE:~4\x2C2%-%DATE:~7\x2C2% %TIME:~0\x2C2%:%TIME:~3\x2C2%:%TIME:~6\x2C2%\nSET APP_PATH\x3D%APP_PARENT%\\%APP_NAME%\n\nSET BACKUP_PARENT\x3D%APP_PATH%-%DATE:~10\x2C4%%DATE:~4\x2C2%%DATE:~7\x2C2%%TIME:~0\x2C2%%TIME:~3\x2C2%%TIME:~6\x2C2%\n\nSET LOGGER\x3D%APP_PARENT%\\%NEW_APP_NAME% Update Log.txt\nECHO \"STARTED ON %TODAY_DATE%\" >> \"%LOGGER%\" 2>&1\n\nFOR /L %%i IN (1\x2C1\x2C10) DO (\n\tIF NOT EXIST \"%PID_FILE%\" (\n\t\tGOTO :program_exited\n\t)\n\n\tREM Windows version of sleep 1. Starting in Windows Vista\x2C the sleep command was removed.\n\tping -n 2 127.0.0.1 >nul\n\n\tIF %%i \x3D\x3D 10 (\n\t\tECHO ERROR: Could not update app\x2C it never quit >> \"%LOGGER%\" 2>&1\n\t\tEXIT /B 1\n\t)\n)\n:program_exited\n\nmkdir \"%BACKUP_PARENT%\"\n\nSET PROCEED\x3D1\n\nREM\nREM Move the other items\nREM\nECHO \"Copying items to backup %BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\nREM We will need to manually populate these move commands. Windows Batch doesn\'t really handle arrays\x2C\nREM only looping through space delimited elements of a string. Below is a template for moving one such file.\n\nREM BEGIN PSEUDO-ARRAY\nSET THIS_ITEM\x3D@@OTHER_NAME@@\nSET THIS_PATH\x3D%APP_PARENT%\\%THIS_ITEM%\nECHO \"Looking for item %THIS_PATH%\" >> \"%LOGGER%\" 2>&1\nIF EXIST \"%THIS_PATH%\" (\n\tGOTO :copy_@@OTHER_NAME_WO_SPACES@@\n)\nECHO \"...not found as file\x2C trying as directory\" >> \"%LOGGER%\" 2>&1\nIF EXIST \"%THIS_PATH%\\NUL\" (\n\tGOTO :copy_@@OTHER_NAME_WO_SPACES@@\n) ELSE (\n\tECHO \"...NOT FOUND!\" >> \"%LOGGER%\" 2>&1\n\tGOTO :finished_with_@@OTHER_NAME_WO_SPACES@@\n)\n\n:copy_@@OTHER_NAME_WO_SPACES@@\n\nECHO \"...found\x2C copying\" >> \"%LOGGER%\" 2>&1\nCOPY \"%THIS_PATH%\" \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\nIF %ERRORLEVEL% NEQ 0 (\n\tECHO \"...FAILED! (Error %ERRORLEVEL%)\" >> \"%LOGGER%\" 2>&1\n\tSET PROCEED\x3D0\n\tGOTO :restore_from_backup\n) ELSE (\n\tECHO \"...confirmed\" >> \"%LOGGER%\" 2>&1\n)\n\n:finished_with_@@OTHER_NAME_WO_SPACES@@\n\nREM END PSEUDO-ARRAY\n\nREM\nREM Move the executable to backup\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Moving the executable %APP_NAME% to backup\" >> \"%LOGGER%\" 2>&1\n\tMOVE \"%APP_PATH%\" \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tIF %ERRORLEVEL% NEQ 0 (\n\t\tECHO \"...FAILED! (Error %ERRORLEVEL%)\" >> \"%LOGGER%\" 2>&1\n\t\tSET PROCEED\x3D0\n\t\tGOTO :restore_from_backup\n\t) ELSE (\n\t\tECHO \"...confirmed\" >> \"%LOGGER%\" 2>&1\n\t)\n)\n\nREM\nREM Make sure there wasn\'t an error during the move\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"All items moved to backup\" >> \"%LOGGER%\" 2>&1\n)\n\nREM\nREM Copy in the replacement files\nREM\n\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Copying files from %NEW_APP_PARENT% to folder %APP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tXCOPY /g /y /e /k \"%NEW_APP_PARENT%\" \"%APP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tIF %ERRORLEVEL% NEQ 0 (\n\t\tECHO \"...FAILED! (Error %ERRORLEVEL%)\" >> \"%LOGGER%\" 2>&1\n\t\tSET PROCEED\x3D0\n\t\tGOTO :restore_from_backup\n\t) ELSE (\n\t\tECHO \"...confirmed\" >> \"%LOGGER%\" 2>&1\n\t)\n)\n\nREM\nREM If we get here\x2C it all worked\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tGOTO :all_succeeded\n)\n\n:restore_from_backup\nIF %PROCEED% \x3D\x3D 0 (\n\tECHO \"Attempting to restore old application\" >> \"%LOGGER%\" 2>&1\n\n\tXCOPY /g /y /e /k \"%BACKUP_PARENT%\" \"%APP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tIF %ERRORLEVEL% EQU 0 (\n\t\tRMDIR /S /Q \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\t)\n)\nGOTO :launch_application\n\n:all_succeeded\nREM\nREM Remove the backup and decompressed folders if everything has gone swimmingly so far\nREM\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"Removing backup...\" >> \"%LOGGER%\" 2>&1\n\tRMDIR /S /Q \"%BACKUP_PARENT%\" >> \"%LOGGER%\" 2>&1\n\tECHO \"... removed\" >> \"%LOGGER%\" 2>&1\n\tECHO \"Removing decompressed folder...\" >> \"%LOGGER%\" 2>&1\n\tRMDIR /S /Q \"%DECOMPRESSED_FOLDER_PATH%\" >> \"%LOGGER%\" 2>&1\n\tECHO \"... removed\" >> \"%LOGGER%\" 2>&1\n\tGOTO :launch_application\n)\n\nREM\nREM Launch the application\nREM\n:launch_application\nECHO \"Launching application...\" >> \"%LOGGER%\" 2>&1\nIF %PROCEED% \x3D\x3D 1 (\n\tECHO \"... new app\" >> \"%LOGGER%\" 2>&1\n\tSTART \"\" \"%APP_PARENT%\\%NEW_APP_NAME%\" --kaju-success \"%APP_VERSION%\"\n\tGOTO :remove_backup_folder\n) ELSE (\n\tECHO \"... OLD app\" >> \"%LOGGER%\" 2>&1\n\tSTART \"\" \"%APP_PATH%\" --kaju-fail\n)\n\n:remove_backup_folder\nECHO \"Removing temp folder...\" >> \"%LOGGER%\" 2>&1\nRMDIR /S /Q \"%TEMP_FOLDER_PATH%\" >> \"%LOGGER%\" 2>&1 && ( ECHO \"... removed\" >> \"%LOGGER%\" 2>&1 && ( ECHO \"DONE\" >> \"%LOGGER%\" 2>&1 ) ) || ( ECHO \"... FAILED!\" >> \"%LOGGER%\" 2>&1 )\n" #tag EndConstant @@ -496,6 +504,7 @@ Protected Class UpdateInitiater Group="ID" InitialValue="-2147483648" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" @@ -503,16 +512,21 @@ Protected Class UpdateInitiater Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="ReplacementExecutableName" + Visible=false Group="Behavior" + InitialValue="" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty @@ -520,7 +534,9 @@ Protected Class UpdateInitiater Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" @@ -528,6 +544,7 @@ Protected Class UpdateInitiater Group="Position" InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/Kaju/ZipShell.xojo_code b/Kaju Classes/Kaju/ZipShell.xojo_code index 965be52..7fec7a3 100644 --- a/Kaju Classes/Kaju/ZipShell.xojo_code +++ b/Kaju Classes/Kaju/ZipShell.xojo_code @@ -256,21 +256,72 @@ Inherits Shell #tag ViewBehavior + #tag ViewProperty + Name="ExecuteMode" + Visible=true + Group="" + InitialValue="" + Type="ExecuteModes" + EditorType="Enum" + #tag EnumValues + "0 - Synchronous" + "1 - Asynchronous" + "2 - Interactive" + #tag EndEnumValues + #tag EndViewProperty + #tag ViewProperty + Name="ExitCode" + Visible=false + Group="Behavior" + InitialValue="" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="Result" + Visible=false + Group="Behavior" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="PID" + Visible=false + Group="Behavior" + InitialValue="" + Type="Integer" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="IsRunning" + Visible=false + Group="Behavior" + InitialValue="" + Type="Boolean" + EditorType="" + #tag EndViewProperty #tag ViewProperty Name="Arguments" Visible=true + Group="" + InitialValue="" Type="String" EditorType="String" #tag EndViewProperty #tag ViewProperty Name="Backend" Visible=true + Group="" + InitialValue="" Type="String" EditorType="String" #tag EndViewProperty #tag ViewProperty Name="Canonical" Visible=true + Group="" + InitialValue="" Type="Boolean" EditorType="Boolean" #tag EndViewProperty @@ -278,35 +329,39 @@ Inherits Shell Name="Index" Visible=true Group="ID" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" + InitialValue="" Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="Mode" - Visible=true - Type="Integer" - EditorType="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="TimeOut" Visible=true + Group="" + InitialValue="" Type="Integer" EditorType="Integer" #tag EndViewProperty @@ -314,7 +369,9 @@ Inherits Shell Name="Top" Visible=true Group="Position" + InitialValue="" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class diff --git a/Kaju Classes/KajuUpdateWindow.xojo_window b/Kaju Classes/KajuUpdateWindow.xojo_window index 384405f..24e855e 100644 --- a/Kaju Classes/KajuUpdateWindow.xojo_window +++ b/Kaju Classes/KajuUpdateWindow.xojo_window @@ -3,7 +3,6 @@ Begin Window KajuUpdateWindow BackColor = &cFFFFFF00 Backdrop = 0 CloseButton = False - Compatibility = "" Composite = True Frame = 0 FullScreen = False @@ -11,7 +10,7 @@ Begin Window KajuUpdateWindow HasBackColor = False Height = 600 ImplicitInstance= True - LiveResize = False + LiveResize = "False" MacProcID = 0 MaxHeight = 32000 MaximizeButton = False @@ -26,31 +25,10 @@ Begin Window KajuUpdateWindow Title = "#KajuLocale.kWindowTitle" Visible = True Width = 800 - Begin HTMLViewer hvNotes - AutoDeactivate = True - Enabled = True - Height = 445 - HelpTag = "" - Index = -2147483648 - Left = 149 - LockBottom = False - LockedInPosition= False - LockLeft = True - LockRight = False - LockTop = True - Renderer = 1 - Scope = 2 - TabIndex = 1 - TabPanelIndex = 0 - TabStop = True - Top = 84 - Visible = True - Width = 631 - End Begin PushButton btnOK AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = False Caption = "#KajuLocale.kInstallButton" Default = True @@ -62,7 +40,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 630 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -74,6 +52,7 @@ Begin Window KajuUpdateWindow TextSize = 0.0 TextUnit = 0 Top = 555 + Transparent = False Underline = False Visible = True Width = 150 @@ -81,7 +60,7 @@ Begin Window KajuUpdateWindow Begin PushButton btnCancel AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = True Caption = "#KajuLocale.kRemindMeLaterButton" Default = False @@ -93,7 +72,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 468 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -105,6 +84,7 @@ Begin Window KajuUpdateWindow TextSize = 0.0 TextUnit = 0 Top = 555 + Transparent = False Underline = False Visible = True Width = 150 @@ -112,7 +92,7 @@ Begin Window KajuUpdateWindow Begin PushButton btnSkipVersion AutoDeactivate = True Bold = False - ButtonStyle = "0" + ButtonStyle = 0 Cancel = False Caption = "#KajuLocale.kSkipVersionButton" Default = False @@ -124,7 +104,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 149 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -136,6 +116,7 @@ Begin Window KajuUpdateWindow TextSize = 0.0 TextUnit = 0 Top = 555 + Transparent = False Underline = False Visible = True Width = 150 @@ -153,7 +134,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 149 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -188,7 +169,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 149 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -223,7 +204,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 149 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -258,7 +239,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 149 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -285,47 +266,37 @@ Begin Window KajuUpdateWindow Enabled = True Height = 20 HelpTag = "" + Indeterminate = False Index = -2147483648 InitialParent = "" Left = 20 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True - Maximum = 0 + Maximum = 100 Scope = 2 TabIndex = 8 TabPanelIndex = 0 - TabStop = True Top = 555 - Value = 0 + Transparent = False + Value = 0.0 Visible = False Width = 117 End - Begin Kaju.HTTPSSocket hsSocket - CertificateFile = - CertificatePassword= "" - CertificateRejectionFile= - ConnectionType = 2 - Enabled = True - ForceSecure = False - Index = -2147483648 - InitialParent = "" - LockedInPosition= False - Scope = 2 - Secure = False - TabPanelIndex = 0 - End Begin Kaju.ZipShell shZipper Arguments = "" Backend = "" Canonical = False - Enabled = True + ErrorCode = 0 Index = -2147483648 InitialParent = "" + IsRunning = False LockedInPosition= False Mode = 1 + PID = 0 + Result = "" Scope = 2 TabPanelIndex = 0 TimeOut = 0 @@ -338,11 +309,11 @@ Begin Window KajuUpdateWindow Index = -2147483648 Left = -345 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True - Renderer = 0 + Renderer = 1 Scope = 2 TabIndex = 9 TabPanelIndex = 0 @@ -364,7 +335,7 @@ Begin Window KajuUpdateWindow Italic = False Left = 20 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True @@ -396,16 +367,16 @@ Begin Window KajuUpdateWindow HelpTag = "" Index = -2147483648 InitialParent = "" - InitialValue = "" + InitialValue = "updates" Italic = False Left = 36 ListIndex = 0 LockBottom = False - LockedInPosition= False + LockedInPosition= True LockLeft = True LockRight = False LockTop = True - Scope = 0 + Scope = 2 TabIndex = 11 TabPanelIndex = 0 TabStop = True @@ -413,19 +384,48 @@ Begin Window KajuUpdateWindow TextSize = 0.0 TextUnit = 0 Top = 87 + Transparent = False Underline = False Visible = True Width = 101 End Begin Timer tmrTimeout - Enabled = True Index = -2147483648 InitialParent = "" LockedInPosition= False Mode = 0 Period = 5000 - Scope = 0 + Scope = 2 + TabPanelIndex = 0 + End + Begin Kaju.HTTPSocketAsync hsSocket + AllowCertificateValidation= False + HTTPStatusCode = 0 + Index = -2147483648 + LockedInPosition= False + Scope = 2 + TabPanelIndex = 0 + End + Begin HTMLViewer hvNotes + AutoDeactivate = True + Enabled = True + Height = 445 + HelpTag = "" + Index = -2147483648 + Left = 149 + LockBottom = False + LockedInPosition= True + LockLeft = True + LockRight = False + LockTop = True + Renderer = 1 + Scope = 2 + TabIndex = 1 TabPanelIndex = 0 + TabStop = True + Top = 84 + Visible = True + Width = 631 End End #tag EndWindow @@ -443,14 +443,13 @@ End Kaju.DeleteRecursive( f ) next + CurrentUpdate = nil + End Sub #tag EndEvent #tag Event Sub Open() - RelativeToFolderItem = GetTemporaryFolderItem - DeleteOnClose.Append RelativeToFolderItem - #if not TargetMacOS then // // Switch the buttons around for other platforms @@ -518,9 +517,7 @@ End end if Kaju.CancelUpdate - if hsSocket.IsConnected then - hsSocket.Disconnect - end if + hsSocket.Disconnect if shZipper.IsRunning then shZipper.Close @@ -536,6 +533,30 @@ End End Sub #tag EndMethod + #tag Method, Flags = &h21 + Private Sub ChangeBackgroudImage(update As Kaju.UpdateInformation) + dim useTransparency as boolean = update.UseTransparency + dim p as Picture = update.Image + if p is nil then + p = Checker.DefaultImage + useTransparency = Checker.DefaultUseTransparency + end if + + if p <> nil and useTransparency then + dim faded as new Picture( p.Width, p.Height ) + + const kTransparencyPercent = 50.0 + faded.Graphics.Transparency = kTransparencyPercent + + faded.Graphics.DrawPicture( p, 0, 0 ) + + p = faded + end if + + self.BackgroundImage = p + End Sub + #tag EndMethod + #tag Method, Flags = &h0 Sub ChooseUpdate(checker As Kaju.UpdateChecker, updates() As Kaju.UpdateInformation) self.Checker = checker @@ -565,6 +586,11 @@ End // Set up the menu with the available updates. // It will set up the rest of the controls. // + // NOTE: Linux requires there to be an initial value in + // the pop-up menu or the Window won't draw + // correctly. + // + pumUpdates.DeleteAllRows for i as integer = 0 to Updates.Ubound dim update as Kaju.UpdateInformation = updates( i ) @@ -586,6 +612,24 @@ End End Sub #tag EndMethod + #tag Method, Flags = &h21 + Private Sub CurrentUpdate_ImageReceived(sender As Kaju.UpdateInformation) + if sender is CurrentUpdate then + ChangeBackgroudImage( CurrentUpdate ) + end if + + End Sub + #tag EndMethod + + #tag Method, Flags = &h21 + Private Sub CurrentUpdate_ReleaseNotesReceived(sender As Kaju.UpdateInformation) + if sender is CurrentUpdate then + DisplayVersionInfo( CurrentUpdate ) + end if + + End Sub + #tag EndMethod + #tag Method, Flags = &h21 Private Sub DisplayVersionInfo(update As Kaju.UpdateInformation) // @@ -612,49 +656,13 @@ End // // Get the background picture, if any // - dim useTransparency as boolean = update.UseTransparency - dim p as Picture = update.Image - if p is nil then - p = Checker.DefaultImage - useTransparency = Checker.DefaultUseTransparency - end if - - if p <> nil and useTransparency then - dim faded as new Picture( p.Width, p.Height, 32 ) - faded.Transparent = Picture.TransparentWhite - - const kTransparencyPercent = 50.0 - #if TargetWindows then - if App.UseGDIPlus then - #endif - faded.Graphics.Transparency = kTransparencyPercent - #if TargetWindows then - end if - #endif - - faded.Graphics.DrawPicture( p, 0, 0 ) - - #if TargetWindows then - if App.UseGDIPlus then - #endif - dim mask as new Picture( p.Width, p.Height ) - mask.Graphics.DrawPicture( p.Mask, 0, 0 ) - faded.Mask = mask - #if TargetWindows then - end if - #endif - - p = faded - end if - - self.BackgroundImage = p + ChangeBackgroudImage update // // Show the release notes // - dim source as string = update.ReleaseNotes - source = Kaju.ProcessReleaseNotes( source ) - hvNotes.LoadPage( source, RelativeToFolderItem ) + dim source as string = update.DisplayReleaseNotes + hvNotes.LoadPage( source, nil ) // // hvNotes.CancelLoad will set self.Loading back to false @@ -717,15 +725,10 @@ End dim url as string = SelectedBinary.URL - // - // Check for redirection - // - url = hsSocket.GetRedirectAddress( url, 5 ) - // // Start the download // - hsSocket.Get( url, DownloadFile ) + hsSocket.Get( url, DownloadFile, true ) // // Start the timeout timer @@ -927,6 +930,31 @@ End Private CurrentStage As Stage #tag EndProperty + #tag ComputedProperty, Flags = &h21 + #tag Getter + Get + return mCurrentUpdate + End Get + #tag EndGetter + #tag Setter + Set + dim current as Kaju.UpdateInformation = mCurrentUpdate + if current isa object then + RemoveHandler current.ImageReceived, WeakAddressOf CurrentUpdate_ImageReceived + RemoveHandler current.ReleaseNotesReceived, WeakAddressOf CurrentUpdate_ReleaseNotesReceived + end if + + mCurrentUpdate = value + if value isa object then + AddHandler value.ImageReceived, WeakAddressOf CurrentUpdate_ImageReceived + AddHandler value.ReleaseNotesReceived, WeakAddressOf CurrentUpdate_ReleaseNotesReceived + end if + + End Set + #tag EndSetter + Private CurrentUpdate As Kaju.UpdateInformation + #tag EndComputedProperty + #tag Property, Flags = &h21 #tag Note Files/folders that shoudl be deleted if the user cancelled @@ -962,7 +990,7 @@ End #tag EndProperty #tag Property, Flags = &h21 - Private RelativeToFolderItem As FolderItem + Attributes( hidden ) Private mCurrentUpdate As Kaju.UpdateInformation #tag EndProperty #tag Property, Flags = &h21 @@ -985,30 +1013,6 @@ End #tag EndWindowCode -#tag Events hvNotes - #tag Event - Function NewWindow() As HTMLViewer - return hvNewWindow - End Function - #tag EndEvent - #tag Event - Function CancelLoad(URL as String) As Boolean - dim r as boolean = not Loading - Loading = false - return r - - #pragma unused URL - End Function - #tag EndEvent - #tag Event - Sub Error(errorNumber as Integer, errorMessage as String) - break - - #pragma unused errorNumber - #pragma unused errorMessage - End Sub - #tag EndEvent -#tag EndEvents #tag Events btnOK #tag Event Sub Action() @@ -1055,96 +1059,6 @@ End End Sub #tag EndEvent #tag EndEvents -#tag Events hsSocket - #tag Event - Sub ReceiveProgress(bytesReceived as integer, totalBytes as integer, newData as string) - if CurrentStage = Stage.Cancelled then - // - // Do nothing - // - return - end if - - // - // Have to get the value below 65536 - // - - const kMaxAllowed = 1000 - - if totalBytes > kMaxAllowed then - dim mult as integer = totalBytes \ kMaxAllowed - totalBytes = totalBytes \ mult - bytesReceived = bytesReceived \ mult - end if - - pbProgress.Maximum = totalBytes - pbProgress.Value = bytesReceived - - tmrTimeout.Reset - - #pragma unused newData - End Sub - #tag EndEvent - #tag Event - Sub DownloadComplete(url as string, httpStatus as integer, headers as internetHeaders, file as folderItem) - if CurrentStage = Stage.Cancelled then - // - // Do nothing - // - return - end if - - pbProgress.Maximum = -1 - pbProgress.Value = 0 - - tmrTimeout.Mode = Timer.ModeOff - - if httpStatus <> 200 then - - ShowError() - - elseif Kaju.HashOfFile( file ) <> SelectedBinary.Hash then - - ShowError( KajuLocale.kBadDownloadMessage ) - - else - // - // We have the file and it appears to be good - // - - lblInstallMessage.Text = KajuLocale.kProcessingFileMessage - - dim targetFolder as FolderItem - #if TargetWindows then - dim targetFolderName as string = SelectedUpdate.AppName + "- decompressed" - targetFolder = App.ExecutableFile.Parent - targetFolder = targetFolder.Child( targetFolderName ) - Kaju.DeleteRecursive( targetFolder ) - #else - targetFolder = file.Parent.Child( "decompressed" ) - #endif - DeleteOnCancel.Append targetFolder - shZipper.Decompress( file, targetFolder ) - end if - - - #pragma unused url - #pragma unused headers - End Sub - #tag EndEvent - #tag Event - Sub Error(code as integer) - if me.IsConnected then - me.Disconnect - end if - - tmrTimeout.Mode = Timer.ModeOff - - ShowError( KajuLocale.kGenericErrorMessage + " (" + str( code ) + ")" ) - - End Sub - #tag EndEvent -#tag EndEvents #tag Events shZipper #tag Event Sub DecompressCompleted(zipFile As FolderItem, containingFolder As FolderItem) @@ -1183,7 +1097,7 @@ End dim f as FolderItem = containingFolder.Item( i ) dim name as string = f.Name dim leftChars as string = name.Left( 1 ) - if leftChars <> "." and leftChars <> "_" then + if leftChars <> "." and leftChars <> "_" and f.Directory then item = f exit end if @@ -1199,6 +1113,15 @@ End Initiater.ReplacementAppFolder = item Initiater.ReplacementExecutableName = SelectedBinary.ExecutableName + #if not TargetMacOS then + if Initiater.ReplacementExecutableName = "" then + // + // We will assume it's the same name + // + Initiater.ReplacementExecutableName = App.ExecutableFile.Name + end if + #endif + btnOK.Enabled = true btnOK.Caption = KajuLocale.kQuitButton btnCancel.Visible = true @@ -1246,6 +1169,8 @@ End // Fill in the viewer // + CurrentUpdate = nil + if me.ListIndex = -1 then if me.ListCount <> 0 then me.ListIndex = 0 @@ -1255,6 +1180,7 @@ End dim update as Kaju.UpdateInformation = me.RowTag( me.ListIndex ) DisplayVersionInfo( update ) + CurrentUpdate = update End Sub #tag EndEvent @@ -1262,57 +1188,178 @@ End #tag Events tmrTimeout #tag Event Sub Action() - if hsSocket.IsConnected then - hsSocket.Disconnect + hsSocket.Disconnect + ShowError( KajuLocale.kTimedOutMessage ) + + End Sub + #tag EndEvent +#tag EndEvents +#tag Events hsSocket + #tag Event + Sub Error(e As RuntimeException) + tmrTimeout.Mode = Timer.ModeOff + + dim errMsg as string = e.Message + if errMsg = "" then + errMsg = KajuLocale.kGenericErrorMessage + end if + + ShowError( errMsg + " (" + str( e.ErrorNumber ) + ")" ) + + End Sub + #tag EndEvent + #tag Event + Sub FileReceived(URL As String, HTTPStatus As Integer, file As FolderItem) + #pragma unused url + + if CurrentStage = Stage.Cancelled then + // + // Do nothing + // + return + end if + + pbProgress.Maximum = -1 + pbProgress.Value = 0 + + tmrTimeout.Mode = Timer.ModeOff + + if httpStatus <> 200 then + + ShowError() + + elseif Kaju.HashOfFile( file ) <> SelectedBinary.Hash then + + ShowError( KajuLocale.kBadDownloadMessage ) + + else + // + // We have the file and it appears to be good + // + + lblInstallMessage.Text = KajuLocale.kProcessingFileMessage + + dim targetFolder as FolderItem + #if TargetWindows then + dim targetFolderName as string = SelectedUpdate.AppName + "- decompressed" + targetFolder = App.ExecutableFile.Parent + targetFolder = targetFolder.Child( targetFolderName ) + Kaju.DeleteRecursive( targetFolder ) + #else + targetFolder = file.Parent.Child( "decompressed" ) + #endif + DeleteOnCancel.Append targetFolder + shZipper.Decompress( file, targetFolder ) + end if + + End Sub + #tag EndEvent + #tag Event + Sub ReceivingProgressed(bytesReceived As Int64, totalBytes As Int64, newData As String) + #pragma unused newData + + if CurrentStage = Stage.Cancelled then + // + // Do nothing + // + return + end if + + // + // Have to get the value below 65536 + // + + const kMaxAllowed = 1000 + + if totalBytes > kMaxAllowed then + dim mult as integer = totalBytes \ kMaxAllowed + totalBytes = totalBytes \ mult + bytesReceived = bytesReceived \ mult + end if + + pbProgress.Maximum = totalBytes + pbProgress.Value = bytesReceived + + tmrTimeout.Reset + + + End Sub + #tag EndEvent +#tag EndEvents +#tag Events hvNotes + #tag Event + Function NewWindow() As Object + return hvNewWindow + + End Function + #tag EndEvent + #tag Event + Function CancelLoad(URL as String) As Boolean + #pragma unused URL + + dim r as boolean = not Loading + Loading = false + return r + + End Function + #tag EndEvent + #tag Event + Sub Error(errorNumber as Integer, errorMessage as String) + #pragma unused errorMessage + + #if TargetMacOS then + const kCancelledCode as integer = -999 + #else + const kCancelledCode as integer = -9999999999 + #endif + + if errorNumber <> kCancelledCode then + break end if - ShowError( KajuLocale.kTimedOutMessage ) End Sub #tag EndEvent #tag EndEvents #tag ViewBehavior #tag ViewProperty - Name="AppName" - Group="Behavior" - Type="String" - EditorType="MultiLineEditor" - #tag EndViewProperty - #tag ViewProperty - Name="BackColor" + Name="MinimumWidth" Visible=true - Group="Appearance" - InitialValue="&hFFFFFF" - Type="Color" + Group="Size" + InitialValue="64" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Backdrop" + Name="MinimumHeight" Visible=true - Group="Appearance" - Type="Picture" - EditorType="Picture" + Group="Size" + InitialValue="64" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="CloseButton" + Name="MaximumWidth" Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" + Group="Size" + InitialValue="32000" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Composite" + Name="MaximumHeight" Visible=true - Group="Appearance" - InitialValue="False" - Type="Boolean" + Group="Size" + InitialValue="32000" + Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Frame" + Name="Type" Visible=true - Group="Appearance" + Group="Frame" InitialValue="0" - Type="Integer" + Type="Types" EditorType="Enum" #tag EnumValues "0 - Document" @@ -1329,143 +1376,155 @@ End #tag EndEnumValues #tag EndViewProperty #tag ViewProperty - Name="FullScreen" - Group="Appearance" - InitialValue="False" + Name="HasCloseButton" + Visible=true + Group="Frame" + InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="FullScreenButton" + Name="HasMaximizeButton" Visible=true - Group="Appearance" - InitialValue="False" + Group="Frame" + InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="HasBackColor" + Name="HasMinimizeButton" Visible=true - Group="Appearance" + Group="Frame" + InitialValue="True" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="HasFullScreenButton" + Visible=true + Group="Frame" InitialValue="False" Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Height" + Name="DefaultLocation" Visible=true - Group="Position" - InitialValue="400" - Type="Integer" + Group="Behavior" + InitialValue="0" + Type="Locations" + EditorType="Enum" + #tag EnumValues + "0 - Default" + "1 - Parent Window" + "2 - Main Screen" + "3 - Parent Window Screen" + "4 - Stagger" + #tag EndEnumValues #tag EndViewProperty #tag ViewProperty - Name="ImplicitInstance" + Name="HasBackgroundColor" Visible=true - Group="Appearance" - InitialValue="True" + Group="Background" + InitialValue="False" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="Interfaces" + Name="BackgroundColor" Visible=true - Group="ID" + Group="Background" + InitialValue="&hFFFFFF" + Type="Color" + EditorType="Color" + #tag EndViewProperty + #tag ViewProperty + Name="AppName" + Visible=false + Group="Behavior" + InitialValue="" Type="String" - EditorType="String" + EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty - Name="LiveResize" + Name="Backdrop" Visible=true Group="Appearance" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" + InitialValue="" + Type="Picture" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MacProcID" + Name="Composite" Visible=true Group="Appearance" - InitialValue="0" - Type="Integer" + InitialValue="False" + Type="Boolean" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="FullScreen" + Visible=false + Group="Appearance" + InitialValue="False" + Type="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MaxHeight" + Name="Height" Visible=true Group="Position" - InitialValue="32000" + InitialValue="400" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MaximizeButton" + Name="ImplicitInstance" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty - Name="MaxWidth" + Name="Interfaces" Visible=true - Group="Position" - InitialValue="32000" + Group="ID" + InitialValue="" + Type="String" + EditorType="" + #tag EndViewProperty + #tag ViewProperty + Name="MacProcID" + Visible=true + Group="Appearance" + InitialValue="0" Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="MenuBar" Visible=true Group="Appearance" + InitialValue="" Type="MenuBar" - EditorType="MenuBar" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="MenuBarVisible" + Visible=false Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="MinHeight" - Visible=true - Group="Position" - InitialValue="64" - Type="Integer" - #tag EndViewProperty - #tag ViewProperty - Name="MinimizeButton" - Visible=true - Group="Appearance" - InitialValue="True" - Type="Boolean" - EditorType="Boolean" - #tag EndViewProperty - #tag ViewProperty - Name="MinWidth" - Visible=true - Group="Position" - InitialValue="64" - Type="Integer" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" - #tag EndViewProperty - #tag ViewProperty - Name="Placement" - Visible=true - Group="Position" - InitialValue="0" - Type="Integer" - EditorType="Enum" - #tag EnumValues - "0 - Default" - "1 - Parent Window" - "2 - Main Screen" - "3 - Parent Window Screen" - "4 - Stagger" - #tag EndEnumValues + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Resizeable" @@ -1473,14 +1532,15 @@ End Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" + InitialValue="" Type="String" - EditorType="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Title" @@ -1488,6 +1548,7 @@ End Group="Appearance" InitialValue="Untitled" Type="String" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Visible" @@ -1495,7 +1556,7 @@ End Group="Appearance" InitialValue="True" Type="Boolean" - EditorType="Boolean" + EditorType="" #tag EndViewProperty #tag ViewProperty Name="Width" @@ -1503,5 +1564,6 @@ End Group="Position" InitialValue="600" Type="Integer" + EditorType="" #tag EndViewProperty #tag EndViewBehavior diff --git a/Kaju Update Test v1.kaju b/Kaju Update Test v1.kaju index 9cc358e..1798d16 100644 --- a/Kaju Update Test v1.kaju +++ b/Kaju Update Test v1.kaju @@ -5,165 +5,175 @@ "KajuData":[ { "AppName":"Kaju Update Test", + "ImageScale":1, "ImageURL":"", "MinimumRequiredVersion":"", "ReleaseNotes":"

This is a fake update for v.1.1 (10). It will really point to a binary of 1.0. (This demonstrates the use of the optional build number for final versions.)<\/p>\n\r

In other words, the app will replace itself.<\/p>\n\n

NOTE<\/b>: The update will warn you that the update will require a payment. THIS IS A LIE!!<\/u> It’s only set that way to test the “Requires Payment” option.<\/p>\n\n

Changes<\/h3>\n