Other Whole new can of worms caused underlying packager

Robert Valentino

Well-Known Member
Licensed User
Longtime User
If you have been following my posted on help images not working (Problem Images not showing)

Well I zipped everything up (as suggested) and have written a routine to unzip the first time during installation.

BUT - before 10.7 I could just modify a help page recompile and install and the help pages were updated (by default).

NOW - I have to modify a help page. Zip it up and then when the program is updated compare a list of files or version number that were changed and unzipped from the zip file.

This is just an FYI (NOT Complaining) that this little change to the "underlying packager handles subfolders" has added a level of complexity to maintaining in my case what help has changed

Just keep this in mind when converting yours if you need to.

I'm actively working on this and am all Ears to and ideas - trying to follow the old KISS method
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Change to html - can you please specify so before I spin my wheels I can try this way.

It's a shame that Android WebView doesn't mht or mhtl files then I believe (everything being a single file) would make everyone's life easier.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
WOW, I came up with a simple way of handling this.

I use this B4J program I wrote that extracts the Version and writes it out to a file
B4X:
    #CustomBuildAction                : 1, D:\B4J\VersionTxt\VersionTxt.exe, "D:\AndroidProjects\BBsPages\B4A\Files"     "BBs_Version.txt"
Which the IDE compiles into my program.

In my program I have alsways an empty zip "helpupdates.zip" if the versions aren't the same I check if there is anything in helpupdates.zip and extract them
This make it pretty simple to update just sections of the help when I do a version update.

Once completely tested I will either manually delete the helpupdates.zip or CustomBuildAction at the end to delete the helpupdates.zip Probablem with custombuild delete is that if I realize I need to do another compile (my help updates will be gone)
B4X:
                If  File.Exists(File.DirAssets, "bbs_version.txt") Then
                    If  File.Exists(File.DirInternal, "bbs_version.txt") Then
                        Dim Asset_Version As String = File.ReadString(File.DirAssets, "bbs_version.txt")
                        Dim APK_Version   As String = File.ReadString(File.DirInternal, "bbs_version.txt")
                    
                        Asset_Version         = Asset_Version.Replace(CRLF, "")
                        Asset_Version.Trim
                        
                        APK_Version            = APK_Version.Replace(CRLF, "")
                        APK_Version.Trim                        
                        
                        Log($"cConsent::ExtractHelp - Versions[${Asset_Version}]  APK[${APK_Version}]"$)
                        
                        If  Asset_Version.CompareTo(APK_Version) <> 0 Then                
                            If  File.Exists(File.DirAssets, "helpupdates.zip") Then
                                File.Copy(File.DirAssets, "helpupdates.zip", File.DirInternal, "helpupdates.zip")
                
                                If  File.Exists(File.DirInternal, "helpupdates.zip")  Then
                                    If  Archiver.NumberOfZipEntries(File.DirInternal, "helpupdates.zip") <> 0 Then                
                                        Log("cConsent::ExtractHelpUpdates - Files Unzipped:" &Archiver.UnZip(File.DirInternal, "helpupdates.zip", File.DirInternal &"/help", "Consent_UnZip"))                
                                    End If
                                End If                            
                            End If
                            
                            File.Copy(File.DirAssets, "bbs_version.txt", File.DirInternal, "bbs_version.txt")                                                                    
                        End If
                    Else                    
                        File.Copy(File.DirAssets, "bbs_version.txt", File.DirInternal, "bbs_version.txt")                                                                
                    End If
                Else                    
                    File.Copy(File.DirAssets, "bbs_version.txt", File.DirInternal, "bbs_version.txt")                                        
                End If

This makes the whole process a little brain dead (AND I surely fit the category)

Enjoy
 

Attachments

  • VersionTxt.zip
    2.5 KB · Views: 88
Upvote 0
Top