Skip to content

Commit

Permalink
v1.9.13 Fixes for update/restart Lintalist
Browse files Browse the repository at this point in the history
  • Loading branch information
lintalist committed Apr 13, 2020
1 parent aa36dcd commit 639685d
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 77 deletions.
12 changes: 11 additions & 1 deletion changelog.md
@@ -1,6 +1,16 @@
### v1.9.13

* New/Fix: "Update lintalist" could fail
- (1) if there was a space in the path https://github.com/lintalist/lintalist/issues/154
but also if the path "includes characters that cannot be used in a compressed folder"
As an alternative it now detects if the console version of 7-zip is present, if so use that
instead of the native Windows ZIP function. See docs\Update.md for instructions.
- (2) missing %A_AhkPath% in Restart routine https://github.com/lintalist/lintalist/issues/163
* Fix: potentially incorrect position of listbox in choice plugin

### v1.9.12

* New: you can now escape [[ and ]] in snippets. https://github.com/lintalist/lintalist/issues/162
* New: you can now escape [[ and ]] in snippets - https://github.com/lintalist/lintalist/issues/162
and additionaly use [,],| in options using alternative notations: <SB, >SB, ^SB (see ParseEscaped in settings.ini)
* New: paste HTML code from clipboard (if present) in the editor https://github.com/lintalist/lintalist/issues/59
* New: Run Query string using special hotkey (hidden expert option) https://github.com/lintalist/lintalist/issues/153
Expand Down
32 changes: 32 additions & 0 deletions docs/Update.md
@@ -0,0 +1,32 @@
# Lintalist Alternative Update methods

During the Lintalist update process it creates a backup in the tmpscripts folder
including all bundles. It may happen there will be an error message:

Compressed (zipped) Folders Error

'path' cannot be compressed because it includes characters
that cannot be used in a compressed folder, such as [...].
You should rename this file or directory.

At that moment the Lintalist update process is stopped and you manually need
to close `Update.ahk` in the tray menu (Green H-icon), right click, Exit.

Note: Discussion on GH @ https://github.com/lintalist/lintalist/issues/154

## Solutions:

1. Start Lintalist again - check for updates, and bypass the backup when asked, or
2. Manually update Lintalist by downloading it from https://github.com/lintalist/lintalist/releases, or
3. Or use 7-zip by following these instructions.

You will need to download the standalone console version from the 7-Zip website - available on the Downloads page:

https://www.7-zip.org/download.html

Look for "7-Zip Extra: standalone console version"

All you need is `7za.exe` - copy that to the Lintalist `include` folder.

Now start Lintalist again, check for updates, and now Lintalist will use 7-zip
to prepare the backup and continue the update process.
6 changes: 3 additions & 3 deletions docs/index.html
Expand Up @@ -20,7 +20,7 @@
<br /><br />
<span style='font-size:.8em;'><b>Lintalist</b> is <b>open source</b> and developed in <a href='https://autohotkey.com/'>AutoHotkey</a>, an easy to learn scripting language for Windows.
[WinXP(sp3)/Vista/7/8/10]<br /></span>
<span class='date' style='float:right;display:inline;margin-top:0px;'>doc rev. 20200411</span></p>
<span class='date' style='float:right;display:inline;margin-top:0px;'>doc rev. 20200413</span></p>
</div>

<div class='column'>
Expand Down Expand Up @@ -86,11 +86,11 @@
</div>

<div class='column'>
<p><b>Download Lintalist <em>1.9.12</em></b>
<p><b>Download Lintalist <em>1.9.13</em></b>
<p>
<a href='https://github.com/lintalist/lintalist/releases'><img src='img/lintalist65x65.gif' alt='Download Lintalist' width='65' align='left' border='0' style='margin-right: 5px;' /></a>
Download (incl. source):<br />
<a href='https://github.com/lintalist/lintalist/releases'><b>Latest release</b></a> (904 kb)<br />Simply unpack and run lintalist.ahk or lintalist.exe<br />
<a href='https://github.com/lintalist/lintalist/releases'><b>Latest release</b></a> (907 kb)<br />Simply unpack and run lintalist.ahk or lintalist.exe<br />
</p>

<span class='tip' style="margin-bottom:10px;"><img src="img/usb.png" width=50 align=right title="USB image by Alessandro Rei (GNU/GPL) - http://findicons.com/icon/255067/usb?id=256158">Lintalist is a <b>portable application</b>. It stores all settings and bundles in the folder the program resides in. <a href="#portable">More...</a>
Expand Down
34 changes: 19 additions & 15 deletions include/PluginHelper.ahk
@@ -1,23 +1,27 @@
; LintaList Include
; Purpose: Parse (nested) plugins properly and assisting functions
; Version: 1.3
;
; See the ProcessText label in Lintalist.ahk
; GrabPlugin() v1
;
; History:
; - 1.3 Process escaped [[ ]] - ParseEscaped()
; - 1.2 Fix GrabPluginOptions to prevent removing closing ) - https://github.com/lintalist/lintalist/issues/125
; - 1.1 Lintalist v1.9.4 added ProcessFunction() and modified GrabPluginOptions() to accommodate functions in snippets
; - 1.0 Lintalist v1.6 - improved plugin parser
/*
LintaList Include
Purpose: Parse (nested) plugins properly and assisting functions
Version: 1.3
See the ProcessText label in Lintalist.ahk
GrabPlugin() v1
History:
- 1.3 Process escaped [[ ]] - ParseEscaped() - https://github.com/lintalist/lintalist/issues/162
- 1.2 Fix GrabPluginOptions to prevent removing closing ) - https://github.com/lintalist/lintalist/issues/125
- 1.1 Lintalist v1.9.4 added ProcessFunction() and modified GrabPluginOptions() to accommodate functions in snippets
- 1.0 Lintalist v1.6 - improved plugin parser
*/

; GrabPlugin is used for local variables only at the moment
GrabPlugin(data,tag="",level="1")
{
if (tag <> "")
tag .= "="
tag .= "="
if RegExMatch(tag,"i)(Clipboard|Selected)")
tag:=trim(tag,"=")
tag:=trim(tag,"=")
Start:=InStr(data,"[[" tag,,,level)
Loop
{
Expand Down Expand Up @@ -60,7 +64,7 @@ CountString(String, Char)
ProcessFunction(function,param)
{
if (param = "")
Return %function%()
Return %function%()

fp:=[]
Loop, parse, param, CSV
Expand Down
3 changes: 2 additions & 1 deletion include/Restart.ahk
Expand Up @@ -6,6 +6,7 @@
; References:
; https://github.com/lintalist/lintalist/issues/127#issuecomment-496279719 and
; https://github.com/lintalist/lintalist/issues/114
; Bug fix: %A_AhkPath% https://github.com/lintalist/lintalist/issues/163

#NoEnv
#SingleInstance, force
Expand All @@ -25,7 +26,7 @@ While WinExist("lintalist.ahk ahk_class AutoHotkey")
Sleep, 1000
}

Run, %LintalistFolder%\tmpscrpts\restarttmp.ahk
Run, %A_AhkPath% "%LintalistFolder%\tmpscrpts\restarttmp.ahk"
Sleep 1000
FileDelete, %LintalistFolder%\tmpscrpts\restarttmp.ahk

Expand Down
104 changes: 68 additions & 36 deletions include/Update.ahk
@@ -1,21 +1,27 @@
; LintaList [standalone script]
; Purpose: Update script for Lintalist
; Version: 1.5
; Date: 20150329
/*
; ChangeButtonNames
; http://ahkscript.org/docs/scripts/MsgBoxButtonNames.htm
LintaList [standalone script]
Purpose: Update script for Lintalist
; CopyFilesAndFolders (AHK Docs)
; http://ahkscript.org/docs/commands/FileCopy.htm
References/credits:
; AutoHotkey wrapper for Windows native Zip feature by Coco
; http://ahkscript.org/boards/viewtopic.php?f=6&t=3892
; https://github.com/cocobelgica/AutoHotkey-ZipFile
ChangeButtonNames
http://ahkscript.org/docs/scripts/MsgBoxButtonNames.htm
; VersionCompare by boiler
; http://ahkscript.org/boards/viewtopic.php?f=6&t=5959
CopyFilesAndFolders (AHK Docs)
http://ahkscript.org/docs/commands/FileCopy.htm
AutoHotkey wrapper for Windows native Zip feature by Coco
http://ahkscript.org/boards/viewtopic.php?f=6&t=3892
https://github.com/cocobelgica/AutoHotkey-ZipFile
VersionCompare by boiler
http://ahkscript.org/boards/viewtopic.php?f=6&t=5959
v1.6 - Use 7-zip console version as backup to bypass
"Compressed (zipped) Folders Error" - see docs\Update.md
*/

DetectHiddenWindows, On
SetTitleMatchMode, 2
Expand All @@ -38,7 +44,7 @@ FileDelete, %UnpackFolder%\checkupdate.ini
FileDelete, %UnpackFolder%\update.zip

URLDownloadToFile, https://raw.githubusercontent.com/lintalist/lintalist/master/version.ini, %UnpackFolder%\checkupdate.ini

IniRead, currentversion, %LintalistFolder%\version.ini, settings, version
If (currentversion = "ERROR")
{
Expand Down Expand Up @@ -86,29 +92,56 @@ If (ErrorLevel = 1 )
FileRemoveDir, %UnpackFolder%\lintalist-master, 1

BackupZip:=UnpackFolder "\Backup-" A_Now ".zip"
backup := new ZipFile(BackupZip)

backup.pack("bundles")
backup.pack("docs")
backup.pack("Extras")
backup.pack("icons")
backup.pack("include")
backup.pack("local")
backup.pack("plugins")
backup.pack("changelog.md")
backup.pack("Settings.ini")
backup.pack("AltPaste.ini")
backup.pack("LineFeed.ini")
backup.pack("multicaret.ini")
backup.pack("lintalist.ahk")
backup.pack("version.ini")
backup.pack("readme.md")

zip := new ZipFile(UnpackFolder "\update.zip")
zip.unpack(, UnpackFolder)

If FileExist(A_ScriptDir "\7za.exe")
7zip:=1

MsgBox, 36, Lintalist, Do you want to prepare a backup of the current version and your bundles in:`n`n%BackupZip%`n`nSee docs\Update.md if you receive an error message during the backup process.

IfMsgBox, Yes ; prepare backup
{

If 7zip
{
RunWait %ComSpec% /c ""%A_ScriptDir%\7za.exe" "u" "tmpscrpts\BackupZip-%A_Now%.zip" "*" "-x!tmpscrpts""
}
else ; native zip functions using class zipfile
{

backup := new ZipFile(BackupZip)

backup.pack("bundles")
backup.pack("docs")
backup.pack("Extras")
backup.pack("icons")
backup.pack("include")
backup.pack("local")
backup.pack("plugins")
backup.pack("themes")
backup.pack("changelog.md")
backup.pack("Settings.ini")
backup.pack("AltPaste.ini")
backup.pack("LineFeed.ini")
backup.pack("multicaret.ini")
backup.pack("lintalist.ahk")
backup.pack("version.ini")
backup.pack("readme.md")

}
}

; unpack downloaded update

If 7zip
RunWait %ComSpec% /c ""%A_ScriptDir%\7za.exe" "x" "tmpscrpts\update.zip" "-otmpscrpts""
else
{
zip := new ZipFile(UnpackFolder "\update.zip")
zip.unpack(, UnpackFolder)
}

WinClose, %LintalistFolder%\lintalist.ahk
Sleep, 1000
Sleep, 1500

; From the AHK docs:
; The following copies all files and folders inside a folder to a different folder:
Expand Down Expand Up @@ -194,4 +227,3 @@ CopyFilesAndFolders(SourcePattern, DestinationFolder, DoOverwrite = false)
; AutoHotkey wrapper for Windows native Zip feature
; https://github.com/cocobelgica/AutoHotkey-ZipFile
#include %A_ScriptDir%\ZipFile.ahk

8 changes: 4 additions & 4 deletions lintalist.ahk
Expand Up @@ -4,7 +4,7 @@ Name : Lintalist
Author : Lintalist
Purpose : Searchable interactive lists to copy & paste text, run scripts,
using easily exchangeable bundles
Version : 1.9.12
Version : 1.9.13
Code : https://github.com/lintalist/
Website : http://lintalist.github.io/
AutoHotkey Forum: https://autohotkey.com/boards/viewtopic.php?f=6&t=3378
Expand Down Expand Up @@ -41,7 +41,7 @@ PluginMultiCaret:=0 ; TODOMC

; Title + Version are included in Title and used in #IfWinActive hotkeys and WinActivate
Title=Lintalist
Version=1.9.12
Version=1.9.13

; Gosub, ReadPluginSettings

Expand Down Expand Up @@ -2074,7 +2074,7 @@ Else If (A_ThisMenuItem = "&About")
Else If (A_ThisMenuItem = "&Quick Start Guide")
Gosub, QuickStartGuideMenu
Else If (A_ThisMenuItem = "Check for updates")
Run, %A_AhkPath% %A_ScriptDir%\include\update.ahk
Run, %A_AhkPath% "%A_ScriptDir%\include\update.ahk"
Else If (A_ThisMenuItem = "&Manage Counters")
{
If cl_ReadOnly
Expand Down Expand Up @@ -2977,7 +2977,7 @@ Return
RunFile:
FileDelete, %TmpDir%\restarttmp.ahk
While FileExist(TmpDir "\restarttmp.ahk")
Sleep 100
Sleep 100
if A_IsAdmin
FileAppend, % "Run, *RunAs " DllCall( "GetCommandLineW", "Str" ), %TmpDir%\restarttmp.ahk, UTF-8 ; reload with command line parameters
else
Expand Down
20 changes: 5 additions & 15 deletions plugins/Choice.ahk
@@ -1,9 +1,10 @@
/*
Plugin : Choice [Standard Lintalist]
Purpose : Make a selection from a list [part of code also placed in lintalist.ahk and used to allow users to select a bundle]
Version : 1.8
Version : 1.9
History:
- 1.9 Adding x/y position for listbox results to prevent possibly position.
- 1.8 Fix for Cancel/Esc not storing position properly, and try to prevent incorrect Listbox heights using Gui10ListboxCheckPosition()
- 1.7 Added option to "filter as you type" by using ! in first item (similar to question using ?) - uses SetEditCueBanner()
Incorporate CancelPlugin (avoids SoundPlay and return nicely)
Expand Down Expand Up @@ -47,8 +48,8 @@ MakeChoice:
Gui, 10:+Owner +AlwaysOnTop +Resize +MinSize
Gui, 10:Default
Gui, 10:font, s%FontSize%
Gui, 10:Add, Edit, x5 y5 w400 vChoiceFilterText gChoiceFilterText hwndHED1,
Gui, 10:Add, ListBox, w400 R10 vItem gChoiceMouseOK, %PluginOptions%
Gui, 10:Add, Edit, x5 y5 w400 vChoiceFilterText gChoiceFilterText hwndHED1,
Gui, 10:Add, ListBox, xp yp+30 w400 R10 vItem gChoiceMouseOK, %PluginOptions%
Gui, 10:Add, button, vChoiceCancel gCancelChoice, &Cancel
Gui, 10:Add, button, xp+90 w80 vChoiceRandom gChoiceRandom, &Random
Gui, 10:Add, Checkbox, xp+90 yp+10 w120 vChoiceAutoCenter gChoiceAutoCenter, Auto Center
Expand All @@ -61,7 +62,7 @@ MakeChoice:
{
GuiControl, Disable, Edit1
GuiControl, Hide, Edit1
Gui, 10:Add, Text, x5 y10 w400, %ChoiceQuestion%
Gui, 10:Add, Text, x5 y10 w400, %ChoiceQuestion%
}
Gui, 10:Font,
GuiCheckXYPos()
Expand All @@ -85,17 +86,6 @@ MakeChoice:
ControlSend, ListBox1, {Down}, Select and press enter
WinWaitClose, Select and press enter
MadeChoice = 1
/*
Loop ; ugly hack: can't use return here because, well it returns and would thus skip the gui and proceed to paste
{
If (MadeChoice = 1) or (InStr(Clip, "[[Choice") = 0)
{
MadeChoice = 0
Break
}
Sleep 20 ; needed for ahk_l, if no sleep CPU usages jumps to 50%, no responding to hotkeys and no tray menu, no longer remember the revision of AHK_L this happened with or if it still ToolTip % A_Index
}
*/
}

Return
Expand Down
2 changes: 1 addition & 1 deletion themes/Themes.md
Expand Up @@ -121,7 +121,7 @@ TextIcon_1.ico to TextIcon_10.ico

Theme icon examples:

`TextIcon_darkmode.ico`
`TextIcon_darkmode.ico`
`TextIcon_1_darkmode.ico`

## Editor icons
Expand Down
2 changes: 1 addition & 1 deletion version.ini
@@ -1,5 +1,5 @@
[settings]
version=1.9.12
version=1.9.13
auto=1
beta=0
; auto = 1 - automatic update possible, set to 0 to alert user to read the release notes
Expand Down

0 comments on commit 639685d

Please sign in to comment.