Skip to content

Commit

Permalink
Beta3: Lift the update script to version 0.0.3-alpha
Browse files Browse the repository at this point in the history
Summary:
  * Update documentation.
  * Change keywords in the `update.ini` file to
    match new `Update.ps1` script.
  * Changes to `Update.ps1` to work with zips
    again.
  • Loading branch information
uroesch committed Mar 15, 2020
1 parent 217760f commit 89c8219
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 51 deletions.
Binary file modified App/AppInfo/appinfo.ini
Binary file not shown.
18 changes: 9 additions & 9 deletions App/AppInfo/update.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[Version]
Package = 1.8.3.0
Display = 1.8.3-beta2-uroesch
Display = 1.8.3-beta3-uroesch

[Archive]
URL1 = https://netcologne.dl.sourceforge.net/project/ldapadmin/ldapadmin/1.8.3/LdapAdminExe-w64-1.8.3.zip
Checksum1 = SHA256:E2E9A3603150D14E2F7AE2CD85878CE187D953FF8FA01FCAA5B73949E573A4DE
TargetDir1 = LdapAdmin64.exe
ExtractDir1 = LdapAdmin.exe
URL2 = https://netcologne.dl.sourceforge.net/project/ldapadmin/ldapadmin/1.8.3/LdapAdminExe-w32-1.8.3.zip
Checksum2 = SHA256:20343E6B2F85E51FFB9CEEB88804CF1E24DA1B1055A48A4AD0ECD170BDDA7BDC
TargetDir2 = LdapAdmin.exe
ExtractDir2 = LdapAdmin.exe
URL1 = https://netcologne.dl.sourceforge.net/project/ldapadmin/ldapadmin/1.8.3/LdapAdminExe-w64-1.8.3.zip
Checksum1 = SHA256:E2E9A3603150D14E2F7AE2CD85878CE187D953FF8FA01FCAA5B73949E573A4DE
TargetName1 = LdapAdmin64.exe
ExtractName1 = LdapAdmin.exe
URL2 = https://netcologne.dl.sourceforge.net/project/ldapadmin/ldapadmin/1.8.3/LdapAdminExe-w32-1.8.3.zip
Checksum2 = SHA256:20343E6B2F85E51FFB9CEEB88804CF1E24DA1B1055A48A4AD0ECD170BDDA7BDC
TargetName2 = LdapAdmin.exe
ExtractName2 = LdapAdmin.exe
93 changes: 52 additions & 41 deletions Other/Update/Update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# -----------------------------------------------------------------------------
# Globals
# -----------------------------------------------------------------------------
$Version = "0.0.3-alpha"
$AppRoot = "$PSScriptRoot\..\.."
$AppInfoDir = "$AppRoot\App\AppInfo"
$AppInfoIni = "$AppInfoDir\appinfo.ini"
Expand All @@ -32,32 +33,30 @@ Function Parse-Ini {
$IniFile
)

$IniContent = Get-Content $IniFile

$resulttable=@()
foreach ($line in $IniContent) {
Debug "Processing $line"
if ($line[0] -eq ";") {
$IniContent = Get-Content $IniFile
$ResultTable = @()
foreach ($Line in $IniContent) {
Debug "Processing '$Line'"
If ($Line[0] -eq ";") {
Debug "Skip comment line"
}

elseif ($line[0] -eq "[") {
$Section = $line.replace("[","").replace("]","")
Debug "Found new section: $Section"
ElseIf ($Line[0] -eq "[") {
$Section = $Line -replace "[\[\]]", ""
Debug "Found new section: '$Section'"
}
elseif ($line -like "*=*") {
ElseIf ($Line -like "*=*") {
Debug "Found Keyline"
$resulttable += @{
$ResultTable += @{
Section = $Section
Key = $line.split("=")[0].Trim()
Value = $line.split("=")[1].Trim()
Key = $Line.split("=")[0].Trim()
Value = $Line.split("=")[1].Trim()
}
}
else {
Debug "Skip line"
}
}
Else {
Debug "Skip line"
}
}
return $resulttable
return $ResultTable
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -95,43 +94,55 @@ Function Check-Sum {
}

# -----------------------------------------------------------------------------
Function Download-ZIP {
Function Download-Release {
param(
[string] $URL,
[string] $Checksum
)
$PathZip = "$PSScriptRoot\$(Url-Basename -URL $URL)"
If (!(Test-Path $PathZip)) {
$DownloadPath = "$PSScriptRoot\$(Url-Basename -URL $URL)"
If (!(Test-Path $DownloadPath)) {
Debug "Downloading file from '$URL'"
Invoke-WebRequest -Uri $URL -OutFile $PathZip
Invoke-WebRequest -Uri $URL -OutFile $DownloadPath
}
If (!(Check-Sum -Checksum $Checksum -File $PathZip)) {
Debug "Checksum of File $PathZip does not match with '$Checksum'"
If (!(Check-Sum -Checksum $Checksum -File $DownloadPath)) {
Debug "Checksum of File $DownloadPath does not match with '$Checksum'"
Exit 1
}
Debug "Downloaded ZIP file '$PathZip'"
return $PathZip
Debug "Downloaded file '$DownloadPath'"
return $DownloadPath
}

# -----------------------------------------------------------------------------
Function Expand-Download {
param(
[string] $ArchiveFile
)
Expand-Archive -LiteralPath $ArchiveFile `
-DestinationPath $PSScriptRoot -Force
}

# -----------------------------------------------------------------------------
Function Update-Zip {
Function Update-Release {
param(
[string] $URL,
[string] $TargetDir,
[string] $ExtractDir,
[string] $TargetName,
[string] $ExtractName,
[string] $Checksum
)
$ZipFile = $(Download-ZIP -URL $URL -Checksum $Checksum)
$TargetPath = "$AppRoot\App\$TargetDir"
Expand-Archive -LiteralPath $ZipFile -DestinationPath $PSScriptRoot -Force
$ReleaseFile = $(Download-Release -URL $URL -Checksum $Checksum)
$TargetPath = "$AppRoot\App\$TargetName"
Switch -regex ($ReleaseFile) {
'\.[Zz][Ii][Pp]$' { Expand-Download -ArchiveFile $ReleaseFile; break }
}
If (Test-Path $TargetPath) {
Write-Output "Removing $TargetPath"
Debug "Removing $TargetPath"
Remove-Item -Path $TargetPath -Force -Recurse
}
Debug "Move $ExtractDir to $TargetPath"
Move-Item -Path $PSScriptRoot\$ExtractDir -Destination $TargetPath -Force
Debug "Cleanup $ZipFile"
Remove-Item $ZipFile
Move-Item -Path $PSScriptRoot\$ExtractName -Destination $TargetPath -Force
If (Test-Path $ReleaseFile) {
Debug "Cleanup $ReleaseFile"
Remove-Item $ReleaseFile
}
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -168,10 +179,10 @@ Function Update-Application() {
If (-Not ($Archive.ContainsKey("URL$Position"))) {
Break
}
Update-ZIP `
Update-Release `
-URL $Archive["URL$Position"] `
-TargetDir $Archive["TargetDir$Position"] `
-ExtractDir $Archive["ExtractDir$Position"] `
-TargetName $Archive["TargetName$Position"] `
-ExtractName $Archive["ExtractName$Position"] `
-Checksum $Archive["Checksum$Position"]
$Position += 1
}
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ A version of LDAP Admin running under the PortableApps.com platform.
This project is in early beta stage.

## Todo
- [ ] Documentation
- [x] Documentation
- [ ] Icons

## Build

### Prerequisites

* [PortableApps.com Launcher](https://portableapps.com/apps/development/portableapps.com_launcher)
* [PortableApps.com Installer](https://portableapps.com/apps/development/portableapps.com_installer)
* [Powershell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7)
* [Wine (Linux / MacOS only)](https://www.winehq.org/)

### Build

To build the installer run the following command in the root of the git repository.

```
powershell Other/Update/Update.ps1
```
177 changes: 177 additions & 0 deletions help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-US"><head><title>LDAP Admin Portable Help</title>
<link rel="alternate" type="application/rss+xml" title="PortableApps.com" href="http://portableapps.com/feeds/general">
<link rel="SHORTCUT ICON" href="Other/Help/images/favicon.ico">
<style>body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 76%;
color: #000;
margin: 20px;
background: #E6E8EA;
text-align: center;
}
a
{
color: #B31616;
font-weight: bold;
}
a:link {
}
a:visited {
}
a:active {
}
a:hover {
color: red;
}
h1, h2, h3, h4, h5, h6 {
font-family: Arial, sans-serif;
font-weight: normal;
}
h1 {
color: #B31616;
font-weight: bold;
letter-spacing: -2px;
font-size: 2.2em;
border-bottom: 1px solid silver;
padding-bottom: 5px;
}
h2 {
font-size: 1.5em;
border-bottom: 1px solid silver;
padding-bottom: 3px;
clear: both;
}
h3 {
font-size: 1.2em;
}
h4 {
font-size: 1.1em;
}
h5 {
font-size: 1.0em;
}
h6 {
font-size: 0.8em;
}
img {
border: 0;
}
ol, ul, li {
font-size: 1.0em;
}
p, table, tr, td, th {
font-size: 1.0em;
}
pre {
font-family: Courier New,Courier,monospace;
font-size: 1.0em;
}
strong, b {
font-weight: bold;
}
table, tr, td {
font-size: 1.0em;
border-collapse: collapse;
}
td, th {
border: 1px solid #aaaaaa;
border-collapse: collapse;
padding: 3px;
}
th {
background: #3667A8;
color: white;
}
ol ol {
list-style-type: lower-alpha;
}
.content {
text-align: left;
margin-left: auto;
margin-right: auto;
width: 780px;
background-color: #FFFFFF;
border-left: 1px solid Black;
border-right: 1px solid Black;
padding: 12px 30px;
line-height: 150%;
}
.logo {
background: #ffffff url("Other/Help/images/help_background_header.png") repeat-x;
width: 840px;
margin-top: 20px;
margin-left: auto;
margin-right: auto;
text-align: left;
border-right: 1px solid black;
border-left: 1px solid black;
}
.footer {
background: #ffffff url("Other/Help/images/help_background_footer.png") repeat-x;
width: 840px;
height: 16px;
margin-left: auto;
margin-right: auto;
text-align: left;
border-right: 1px solid black;
border-left: 1px solid black;
}
.logo img {
padding-left: 0px;
border: none;
position: relative;
top: -4px;
}
* html .content {
width: 760px;
}
* html .logo, * html .footer {
width: 820px;
}
.content h1 {
margin: 0px;
}
h1.hastagline {
border: 0;
}
h2.tagline {
color: #747673;
clear: none;
margin-top: 0em;
}
/*printer styles*/
@media print{
body, .content {margin: 0; padding: 0;}
.navigation, .locator, .footer a, .message, .footer-links {display:none;}
.footer, .content, .header {border: none;}
a {text-decoration: none; font-weight: normal; color: black;}
}</style>
</head>
<body>
<div class="logo"><a href="http://portableapps.com/"><img src="Other/Help/images/help_logo_top.png" width="229" height="47" alt="PortableApps.com - Your Digital Life, Anywhere"></a></div>
<div class="content">
<h1 class="hastagline">LDAP Admin Portable Help</h1>
<h2 class="tagline">compare files on the go</h2>
<p>LDAP Admin Portable allows you to compare and diff files on the go. <a href="http://www.ldapadmin.org/"/>Learn more about LDAP Admin...</a></p>

<a href="http://portableapps.com/donate"><img src="Other/Help/images/donation_button.png" width="110" height="23" border="0" align="top" alt="Make a Donation"></a> - Support PortableApps.com's Hosting and Development

<p><a href="http://github.com/uroesch/LdapAdminPortable">Go to the LDAP Admin Portable Homepage &gt;&gt;</a></p>

<p><a href="http://portableapps.com/">Get more portable apps at PortableApps.com</a></p>

<p>This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.</p>

<h2>LDAP Admin Portable-Specific Issues</h2>
<ul>
<li><a href="http://portableapps.com/support/portable_app#downloading">Downloading a Portable App</a></li>
<li><a href="http://portableapps.com/support/portable_app#installing">Installing a Portable App</a></li>
<li><a href="http://portableapps.com/support/portable_app#using">Using a Portable App</a></li>
<li><a href="http://portableapps.com/support/portable_app#upgrading">Upgrading a Portable App</a></li>
</ul>

</div>
<div class="footer"></div>
</body>
</html>

0 comments on commit 89c8219

Please sign in to comment.