Skip to content

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ktekinay committed Jan 11, 2015
2 parents c5b3a0e + bb625d2 commit 6e570c3
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 184 deletions.
7 changes: 4 additions & 3 deletions Kaju Admin App/Kaju Admin.xojo_project
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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
Expand All @@ -25,13 +26,13 @@ Class=FolderItemAlias;Other Classes/FolderItemAlias.xojo_code;&h53EF1AE5;&h6AF5D
Class=HTTPSSocket;../Kaju Classes/Kaju/HTTPSSocket.xojo_code;&h5ACDFAEB;&h11400316;false
AppMenuBar=MainMenuBar
MajorVersion=1
MinorVersion=0
MinorVersion=1
SubVersion=0
NonRelease=0
Release=3
InfoVersion=Kaju Admin
LongVersion=v.1.0
ShortVersion=1.0
LongVersion=v.1.1
ShortVersion=1.1
WinCompanyName=MacTechnologies Consulting
WinInternalName=
WinProductName=
Expand Down
Binary file added Kaju Admin App/Kaju Admin_DE.xojo_locale
Binary file not shown.
11 changes: 8 additions & 3 deletions Kaju Classes/Kaju/BinaryInformation.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Inherits Kaju.Information
dim r as boolean

if not r and Hash.Trim = "" then
reason = "Missing Hash"
reason = KajuLocale.kMissingReason + " Hash"
r = true
end if

if not r and URL.Trim = "" then
reason = "Missing URL"
reason = KajuLocale.kMissingReason + " URL"
r = true
end if

if not r and IsExecutableNameRequired and ExecutableName.Trim = "" then
reason = "Missing Executable Name"
reason = KajuLocale.kMissingReason + " Executable Name"
r = true
end if

Expand Down Expand Up @@ -121,6 +121,11 @@ Inherits Kaju.Information
InitialValue="-2147483648"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="IsValid"
Group="Behavior"
Type="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Expand Down
9 changes: 6 additions & 3 deletions Kaju Classes/Kaju/KajuException.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ Inherits RuntimeException
#tag EndMethod


#tag Constant, Name = kErrorCantFindLibsFolder, Type = String, Dynamic = False, Default = \"Can\xE2\x80\x99t locate this applications Libs folder.", Scope = Public
#tag Constant, Name = kErrorCantFindLibsFolder, Type = String, Dynamic = True, Default = \"Can\xE2\x80\x99t locate this applications Libs folder.", Scope = Public
#Tag Instance, Platform = Any, Language = de, Definition = \"Kann den Applications Libs Ordner dieser Anwendung nicht finden."
#tag EndConstant

#tag Constant, Name = kErrorImproperFunction, Type = String, Dynamic = False, Default = \"This function cannot be used on this platform.", Scope = Public
#tag Constant, Name = kErrorImproperFunction, Type = String, Dynamic = True, Default = \"This function cannot be used on this platform.", Scope = Public
#Tag Instance, Platform = Any, Language = de, Definition = \"Diese Funktion kann auf dieser Platform nicht benutzt werden."
#tag EndConstant

#tag Constant, Name = kErrorMissingUpdateURL, Type = String, Dynamic = False, Default = \"The update URL is missing.", Scope = Public
#tag Constant, Name = kErrorMissingUpdateURL, Type = String, Dynamic = True, Default = \"The update URL is missing.", Scope = Public
#Tag Instance, Platform = Any, Language = de, Definition = \"Die Update URL fehlt."
#tag EndConstant


Expand Down
30 changes: 9 additions & 21 deletions Kaju Classes/Kaju/UpdateChecker.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Protected Class UpdateChecker
exit do

elseif raw = "" then
if HandleError( kErrorNoUpdateData ) then
if HandleError( KajuLocale.kErrorNoUpdateData ) then
continue do
else
exit do
Expand All @@ -106,14 +106,14 @@ Protected Class UpdateChecker

raw = raw.DefineEncoding( Encodings.UTF8 )

dim firstLine as string
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
if HandleError( kErrorIncorrectPacketMarker ) then
if HandleError( KajuLocale.kErrorIncorrectPacketMarker ) then
continue do
else
exit do
Expand All @@ -123,7 +123,7 @@ Protected Class UpdateChecker
sig = firstLine.Mid( sig.Len + 1 )
sig = DecodeHex( sig )
if not Crypto.RSAVerifySignature( raw, sig, ServerPublicRSAKey ) then
if HandleError( kErrorIncorrectPacketSignature ) then
if HandleError( KajuLocale.kErrorIncorrectPacketSignature ) then
continue do
else
exit do
Expand Down Expand Up @@ -151,11 +151,11 @@ Protected Class UpdateChecker
//
dim dlg as new MessageDialog
dlg.ActionButton.Visible = true
dlg.ActionButton.Caption = "Try Again"
dlg.ActionButton.Caption = KajuLocale.kTryAgainButton
dlg.CancelButton.Visible = true
dlg.CancelButton.Caption = "Later"
dlg.CancelButton.Caption = KajuLocale.kLaterButton
dlg.AlternateActionButton.Visible = false
dlg.Message = "An error has occurred. Would you like to try again now or later?"
dlg.Message = KajuLocale.kErrorOccurredMessage
dlg.Explanation = msg

dim btn as MessageDialogButton = dlg.ShowModal
Expand Down Expand Up @@ -362,7 +362,7 @@ Protected Class UpdateChecker
return true

Exception err as RuntimeException
return not HandleError( kErrorBadUpdateData )
return not HandleError( KajuLocale.kErrorBadUpdateData )

End Function
#tag EndMethod
Expand Down Expand Up @@ -417,7 +417,7 @@ Protected Class UpdateChecker

#tag Method, Flags = &h21
Private Sub SeparatePacket(raw As String, ByRef firstLine As String, ByRef remainder As String)
// Separate the incoming packet by the EOL when we don't know exactly what
// Separate the incoming packet by the EOL when we don't know exactly what
// the EOL is.

dim rx as new RegEx
Expand Down Expand Up @@ -570,18 +570,6 @@ Protected Class UpdateChecker
#tag Constant, Name = kAllowUpdateWindow, Type = Double, Dynamic = False, Default = \"&b10000000", Scope = Public
#tag EndConstant

#tag Constant, Name = kErrorBadUpdateData, Type = String, Dynamic = False, Default = \"The update data cannot be read.", Scope = Private
#tag EndConstant

#tag Constant, Name = kErrorIncorrectPacketMarker, Type = String, Dynamic = False, Default = \"The update packet signature marker was incorrect.", Scope = Private
#tag EndConstant

#tag Constant, Name = kErrorIncorrectPacketSignature, Type = String, Dynamic = False, Default = \"The RSA signature of the update packet cannot be verified.", Scope = Private
#tag EndConstant

#tag Constant, Name = kErrorNoUpdateData, Type = String, Dynamic = False, Default = \"No update data was available.", Scope = Private
#tag EndConstant

#tag Constant, Name = kPreferencesName, Type = String, Dynamic = False, Default = \"Kaju_Preferences", Scope = Private
#tag EndConstant

Expand Down
10 changes: 5 additions & 5 deletions Kaju Classes/Kaju/UpdateInformation.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ Inherits Kaju.Information
dim r as boolean

if not r and rxVersion.Search( Version ) is nil then
reason = "Version must be in one of these forms: 1, 1.2, 1.2.3, 1.2d4, 1.2a4, 1.2b4, 1.2.4b4, etc."
reason = KajuLocale.kVersionMustBeInFormReason + ": 1, 1.2, 1.2.3, 1.2d4, 1.2a4, 1.2b4, 1.2.4b4, etc."
r = true
end if

if not r and AppName.Trim = "" then
reason = "Missing app name"
reason = KajuLocale.kMissingAppNameReason
r = true
end if

if not r and MacBinary <> nil and not MacBinary.IsValid then
reason = "Mac Binary information is not valid: " + MacBinary.InvalidReason
reason = "Mac " + KajuLocale.kBinaryInfoInvalidReason + ": " + MacBinary.InvalidReason
r = true
end if

if not r and WindowsBinary <> nil and not WindowsBinary.IsValid then
reason = "Windows Binary information is not valid: " + WindowsBinary.InvalidReason
reason = "Windows " + KajuLocale.kBinaryInfoInvalidReason + ": " + WindowsBinary.InvalidReason
r = true
end if

if not r and LinuxBinary <> nil and not LinuxBinary.IsValid then
reason = "Linux Binary information is not valid: " + LinuxBinary.InvalidReason
reason = "Linux " + KajuLocale.kBinaryInfoInvalidReason + ": " + LinuxBinary.InvalidReason
r = true
end if

Expand Down
200 changes: 200 additions & 0 deletions Kaju Classes/KajuLocale.xojo_code
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
#tag Module
Protected Module KajuLocale
#tag Note, Name = About

Any data that needs to be localized (strings, mostly) goes here.

The only exceptions are strings that might need to be compared by the developer,
like error messages in KajuException.
#tag EndNote


#tag Constant, Name = kAppMarker, Type = String, Dynamic = False, Default = \"<<AppName>>", Scope = Protected
#tag EndConstant

#tag Constant, Name = kBadDownloadMessage, Type = String, Dynamic = True, Default = \"The downloaded file appears to be corrupted.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Die heruntergeladene Datei scheint defekt zu sein."
#tag EndConstant

#tag Constant, Name = kBinaryInfoInvalidReason, Type = String, Dynamic = True, Default = \"Binary information is not valid", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Bin\xC3\xA4re Informationen sind nicht valide"
#tag EndConstant

#tag Constant, Name = kCancelButton, Type = String, Dynamic = True, Default = \"&Cancel", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"&Abbrechen"
#tag EndConstant

#tag Constant, Name = kCannotSkipVersionsMessage, Type = String, Dynamic = True, Default = \"You cannot skip versions until you have updated to version <<Version>> or beyond.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Sie k\xC3\xB6nnen keine Versionen \xC3\xBCberspringen bevor Sie nicht mindestens <<Version>> oder h\xC3\xB6her installiert haben."
#tag EndConstant

#tag Constant, Name = kDownloadingMessage, Type = String, Dynamic = True, Default = \"Downloading...", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Herunterladen..."
#tag EndConstant

#tag Constant, Name = kDryRunMessage, Type = String, Dynamic = True, Default = \"(Dry run\x2C not really installing)", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"(Testlauf\x2C keine wirkliche Installation)"
#tag EndConstant

#tag Constant, Name = kErrorBadUpdateData, Type = String, Dynamic = True, Default = \"The update data cannot be read.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Update Informationen k\xC3\xB6nnen nicht gelesen werden."
#tag EndConstant

#tag Constant, Name = kErrorIncorrectPacketMarker, Type = String, Dynamic = True, Default = \"The update packet signature marker was incorrect.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Die Update Paket Signatur war inkorrekt."
#tag EndConstant

#tag Constant, Name = kErrorIncorrectPacketSignature, Type = String, Dynamic = True, Default = \"The RSA signature of the update packet cannot be verified.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Die RSA Signatur des Update Paket kann nicht verifiziert werden."
#tag EndConstant

#tag Constant, Name = kErrorNoUpdateData, Type = String, Dynamic = True, Default = \"No update data was available.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Es standen keine Update Informationen zur Verf\xC3\xBCgung."
#tag EndConstant

#tag Constant, Name = kErrorOccurredMessage, Type = String, Dynamic = True, Default = \"An error has occurred. Would you like to try again now or later\?", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Es ist ein Fehler aufgetreten. M\xC3\xB6chten Sie es jetzt oder sp\xC3\xA4ter noch einmal versuchen\?"
#tag EndConstant

#tag Constant, Name = kGenericErrorMessage, Type = String, Dynamic = True, Default = \"An error has occurred.", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Es ist ein Fehler aufgetreten."
#tag EndConstant

#tag Constant, Name = kInstallButton, Type = String, Dynamic = True, Default = \"Install Update", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Update installieren"
#tag EndConstant

#tag Constant, Name = kLaterButton, Type = String, Dynamic = True, Default = \"Later", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Sp\xC3\xA4ter"
#tag EndConstant

#tag Constant, Name = kMainNotice, Type = String, Dynamic = True, Default = \"A new version of <<AppName>> is available!", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Eine neue <<AppName>> Version ist verf\xC3\xBCgbar!"
#tag EndConstant

#tag Constant, Name = kMissingAppNameReason, Type = String, Dynamic = True, Default = \"Missing app name", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"App Name fehlt"
#tag EndConstant

#tag Constant, Name = kMissingReason, Type = String, Dynamic = False, Default = \"Missing", Scope = Protected
#tag EndConstant

#tag Constant, Name = kNewVersionMarker, Type = String, Dynamic = False, Default = \"<<NewVersion>>", Scope = Protected
#tag EndConstant

#tag Constant, Name = kNoUpdateInfoMessage, Type = String, Dynamic = True, Default = \"NO UPDATE INFORMATION", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"KEINE UPDATE INFORMATIONEN"
#tag EndConstant

#tag Constant, Name = kPaymentRequiredMessage, Type = String, Dynamic = True, Default = \"This update is not free and will require payment. Proceed anyway\?", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Das ist ein kostenpflichtiges Update. Dennoch installieren\?"
#tag EndConstant

#tag Constant, Name = kProceedButton, Type = String, Dynamic = True, Default = \"Proceed", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Weiter"
#tag EndConstant

#tag Constant, Name = kProcessingFileMessage, Type = String, Dynamic = True, Default = \"Processing file...", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Verarbeite Datei..."
#tag EndConstant

#tag Constant, Name = kQuitButton, Type = String, Dynamic = True, Default = \"Quit && Install", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Beenden && Installieren"
#tag EndConstant

#tag Constant, Name = kReadyMessage, Type = String, Dynamic = True, Default = \"Ready to install", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Zum Update bereit"
#tag EndConstant

#tag Constant, Name = kReleaseNotesLabel, Type = String, Dynamic = True, Default = \"Release Notes:", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Informationen zur Ver\xC3\xB6ffentlichung:"
#tag EndConstant

#tag Constant, Name = kRemindMeLaterButton, Type = String, Dynamic = True, Default = \"Remind Me Later", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Jetzt nicht"
#tag EndConstant

#tag Constant, Name = kSecondaryNoticeMultiple, Type = String, Dynamic = True, Default = \"You have version <<ThisVersion>> and there are multiple updates available. Install one\?", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Sie haben Version <<ThisVersion>> und es stehen mehrere Updates zur Verf\xC3\xBCgung. Ein Update installieren\?"
#tag EndConstant

#tag Constant, Name = kSecondaryNoticeOne, Type = String, Dynamic = True, Default = \"You have version <<ThisVersion>>. Would you like to install version <<NewVersion>>\?", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Sie haben Version <<ThisVersion>>. M\xC3\xB6chten Sie die Version <<NewVersion>> installieren\?"
#tag EndConstant

#tag Constant, Name = kSkipVersionButton, Type = String, Dynamic = True, Default = \"Skip Version", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Version \xC3\xBCberspringen"
#tag EndConstant

#tag Constant, Name = kStopButton, Type = String, Dynamic = True, Default = \"Stop", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Stopp"
#tag EndConstant

#tag Constant, Name = kThisApplication, Type = String, Dynamic = True, Default = \"this application", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"diese Anwendung"
#tag EndConstant

#tag Constant, Name = kThisVersionMarker, Type = String, Dynamic = False, Default = \"<<ThisVersion>>", Scope = Protected
#tag EndConstant

#tag Constant, Name = kTryAgainButton, Type = String, Dynamic = True, Default = \"Try Again", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Erneut versuchen"
#tag EndConstant

#tag Constant, Name = kTryLaterButton, Type = String, Dynamic = True, Default = \"Try Later", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Sp\xC3\xA4ter erneut versuchen"
#tag EndConstant

#tag Constant, Name = kVersionMarker, Type = String, Dynamic = False, Default = \"<<Version>>", Scope = Protected
#tag EndConstant

#tag Constant, Name = kVersionMustBeInFormReason, Type = String, Dynamic = True, Default = \"Version must be in one of these forms", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Version muss in einer der folgenden Formen eingegeben werden"
#tag EndConstant

#tag Constant, Name = kVersionsLabel, Type = String, Dynamic = True, Default = \"Available Versions:", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Verf\xC3\xBCgbare Versionen:"
#tag EndConstant

#tag Constant, Name = kWindowTitle, Type = String, Dynamic = True, Default = \"Update Available", Scope = Protected
#Tag Instance, Platform = Any, Language = de, Definition = \"Update verf\xC3\xBCgbar"
#tag EndConstant


#tag ViewBehavior
#tag ViewProperty
Name="Index"
Visible=true
Group="ID"
InitialValue="-2147483648"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="Top"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
#tag EndViewProperty
#tag EndViewBehavior
End Module
#tag EndModule
Loading

0 comments on commit 6e570c3

Please sign in to comment.