154 |
Joplin Portable Help
155 |
compare files on the go
156 |
Joplin Portable allows you to compare and diff files on the go. Learn more about Joplin...
157 |
158 |

- Support PortableApps.com's Hosting and Development
159 |
160 |
Go to the Joplin Portable Homepage >>
161 |
162 |
Get more portable apps at PortableApps.com
163 |
164 |
This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
165 |
166 |
Joplin Portable-Specific Issues
167 |
173 |
174 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------
/Other/Update/Initialize.ps1:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env pwsh
2 |
3 | # -----------------------------------------------------------------------------
4 | # Modules
5 | # -----------------------------------------------------------------------------
6 | Using module ".\PortableAppsCommon.psm1"
7 |
8 |
9 | # -----------------------------------------------------------------------------
10 | # Globals
11 | # -----------------------------------------------------------------------------
12 | $Version = "0.0.2-alpha"
13 | $Debug = $True
14 | $Files = @(
15 | (Join-Path $AppRoot help.html)
16 | (Join-Path $AppRoot README.md)
17 | (Join-Path $AppRoot LICENSE)
18 | $AppInfoIni
19 | $UpdateIni
20 | )
21 |
22 | $Placeholders = @{
23 | AppName = @{
24 | Message = 'Application name e.g. "FooPortable"'
25 | Value = ''
26 | }
27 | AppNameSpaced = @{
28 | Message = 'Application name with spaces e.g. "Foo Portable"'
29 | Value = ''
30 | }
31 | UpstreamPublisher = @{
32 | Message = 'Publishers name e.g. "ACME Ltd."'
33 | Value = ''
34 | }
35 | UpstreamUrl = @{
36 | Message = "Upstream project's URL. e.g. `"https://acme.ltd/foo`""
37 | Value = ''
38 | }
39 | UpstreamName = @{
40 | Message = 'Upstream name e.g. "Foo"'
41 | Value = ''
42 | }
43 | UpstreamDescription = @{
44 | Message = 'App description e.g. "Best app ever..."'
45 | Value = ''
46 | }
47 | UpstreamLicense = @{
48 | Message = 'Upstream license e.g. "GPL2", "MIT", "BSD"...'
49 | Value = ''
50 | }
51 | Category = @{
52 | Message = 'App category e.g. "Utilities"'
53 | Value = 'Utilities'
54 | }
55 | Language = @{
56 | Message = 'Installer language e.g. "Multilingual"'
57 | Value = 'Multilingual'
58 | }
59 | PackageVersion = @{
60 | Message = 'Package version 4 digits delimited by dot e.g. "1.2.3.0"'
61 | Value = ''
62 | }
63 | DisplayVersion = @{
64 | Message = 'Display version e.g. "1.2.3-beta1-uroesch"'
65 | Value = ''
66 | }
67 | UpstreamVersion = @{
68 | Message = 'Upstream version e.g. "1.2.3"'
69 | Value = ''
70 | }
71 | AppProjectUrl = @{
72 | Message = 'App project URL e.g. "https://github.com/uroesch/FooPortable"'
73 | Value = ''
74 | }
75 | GitHubUser = @{
76 | Message = 'GitHubUser e.g. "uroesch"'
77 | Value = ''
78 | }
79 | }
80 |
81 | # -----------------------------------------------------------------------------
82 | # Functions
83 | # -----------------------------------------------------------------------------
84 | Function Assign-Placeholder() {
85 | Param(
86 | [String] $Key,
87 | [String] $Value
88 | )
89 | Try {
90 | $Placeholders[$Key]['Value'] = $Value
91 | Debug info "Placeholder '$Key' set to '$Value'"
92 | }
93 | Catch {
94 | Debug Error "Failed to assign placeholder '$Key' to '$Value'"
95 | Error 124
96 | }
97 | }
98 |
99 | Function Replace-Placeholder() {
100 | Param(
101 | [String] $Key,
102 | [String] $Content
103 | )
104 | $Pattern = "{{ $Key }}"
105 | $Value = $Placeholders[$Key].Value
106 | If ($Content -match $Pattern) {
107 | $Content = $Content -replace $Pattern, $Value
108 | Debug info "Replace '$Pattern' with '$Value'"
109 | }
110 | $Content
111 | }
112 |
113 | Function Replace-Placeholders() {
114 | Foreach ($Path in $Files) {
115 | $Content = Get-Content -Path $Path -Raw
116 | $Placeholders.Keys | ForEach {
117 | If ($Placeholders[$_].Value -ne "") {
118 | $Content = Replace-Placeholder -Key $_ -Content $Content
119 | }
120 | }
121 | Set-Content -Value $Content -Path $Path -Encoding utf-8
122 | }
123 | }
124 |
125 |
126 | Function Check-Initial() {
127 | If ($AppName -notmatch 'Portable$') {
128 | Debug error "App directory '$AppName' does not end with 'Portable'"
129 | Exit 123
130 | }
131 | $AppNameSpaced = $AppName -replace "Portable$", " Portable"
132 | $UpstreamName = $AppName -replace "Portable$", ""
133 | Assign-Placeholder -Key AppName -Value $AppName
134 | Assign-Placeholder -Key AppNameSpaced -Value $AppNameSpaced
135 | Assign-Placeholder -Key UpstreamName -Value $UpstreamName
136 | }
137 |
138 | Function Rename-Launcher() {
139 | $DefaultLauncher = Join-Path $LauncherDir Rename-to-AppName.ini
140 | If (Test-Path $DefaultLauncher) {
141 | Debug info "Rename '$DefaultLauncher' to '$LauncherIni'"
142 | Move-Item -Path $DefaultLauncher -Destination $LauncherIni
143 | }
144 | }
145 |
146 | Function Query-GitOrigin() {
147 | $Origin = git config --get remote.origin.url
148 | If ($Origin -match '^http') {
149 | # extract the project url
150 | $Origin = $Origin -replace ".git$", ""
151 | Assign-Placeholder -Key AppProjectUrl -Value $Origin
152 | # extract github user
153 | $GitHubUser = $Origin -replace "/$AppName$", "" -replace ".*/", ""
154 | Assign-Placeholder -Key GitHubUser -Value $GitHubUser
155 | }
156 | }
157 |
158 | Function Ask-Question() {
159 | Param(
160 | [String] $Key
161 | )
162 | $Value = $Placeholders[$Key].Value
163 | $Prompt = "`nPlaceholer {0} {1}`nDefault [{2}]" -f `
164 | $Key, $Placeholders[$Key].Message, $Value
165 | $Result = Read-Host -Prompt $Prompt
166 | $Result = $Result.Trim()
167 | If ($Result -ne '') {
168 | Assign-Placeholder -Key $Key -Value $Result
169 | Return
170 | }
171 | ElseIf ($Value -ne '' -and $Result -eq '') {
172 | Return
173 | }
174 | ElseIf ($Value -eq '' -and $Result -eq '') {
175 | Ask-Question -Key $Key
176 | }
177 | }
178 |
179 | Function Questionaire() {
180 | $Placeholders.Keys | Sort-Object | %{
181 | Ask-Question -Key $_
182 | }
183 | }
184 |
185 | # -----------------------------------------------------------------------------
186 | # Functions
187 | # -----------------------------------------------------------------------------
188 | Check-Initial
189 | Rename-Launcher
190 | Query-GitOrigin
191 | Questionaire
192 | Replace-Placeholders
193 |
--------------------------------------------------------------------------------
/Other/Update/PA-Upgrade.ps1:
--------------------------------------------------------------------------------
1 | # -----------------------------------------------------------------------------
2 | # Description: Generic Update Script for PortableApps
3 | # Author: Urs Roesch