Skip to content

Commit

Permalink
v1.4.12.43 - install directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdelsol committed Mar 25, 2024
1 parent 1196d7a commit 6a1d323
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 23 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# <kbd><img src="resources/Sfvip%20All.png" width="45"></kbd> Sfvip All
***Sfvip All*** wraps ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** to add new features:
**Sfvip All** wraps ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** to add new features:
* Insert an _All_ category when missing so you can easily **search your entire catalog**.
<kbd><img src="resources/readme/all.png"></kbd>
* Update ***[Mpv](https://mpv.io/)*** and **Sfvip Player** so you can enjoy their latest features.
Expand All @@ -9,11 +9,11 @@

[^1]: External EPG doesn't work with **local** m3u accounts.
# Downloads
[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.42-informational?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="35"><img src="https://img.shields.io/badge/x64-informational?logo=Windows10&logoColor=lightblue&style=flat-square" height="35"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen?logo=shield-check&logoColor=white&style=flat-square" height="35">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.42/Install.Sfvip.All.1.4.12.42.x64.exe)
<sup><sup>_by MS Defender • 1.1.24020.9 • 1.407.627.0_</sup></sup>
[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.43-informational?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="35"><img src="https://img.shields.io/badge/x64-informational?logo=Windows10&logoColor=lightblue&style=flat-square" height="35"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen?logo=shield-check&logoColor=white&style=flat-square" height="35">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.43/Install.Sfvip.All.1.4.12.43.x64.exe)
<sup><sup>_by MS Defender • 1.1.24020.9 • 1.407.706.0_</sup></sup>

[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.42-informational?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="35"><img src="https://img.shields.io/badge/x86-informational?logo=Windows10&logoColor=lightblue&style=flat-square" height="35"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen?logo=shield-check&logoColor=white&style=flat-square" height="35">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.42/Install.Sfvip.All.1.4.12.42.x86.exe)
<sup><sup>_by MS Defender • 1.1.24020.9 • 1.407.627.0_</sup></sup>
[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.43-informational?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="35"><img src="https://img.shields.io/badge/x86-informational?logo=Windows10&logoColor=lightblue&style=flat-square" height="35"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen?logo=shield-check&logoColor=white&style=flat-square" height="35">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.43/Install.Sfvip.All.1.4.12.43.x86.exe)
<sup><sup>_by MS Defender • 1.1.24020.9 • 1.407.706.0_</sup></sup>

[<a href="https://tooomm.github.io/github-release-stats/?username=sebdelsol&repository=sfvip-all"><img src="https://img.shields.io/github/downloads/sebdelsol/sfvip-all/total?color=informational&logo=github&labelColor=informational&style=flat-square" height="25"></a><a href="https://github.com/sebdelsol/sfvip-all/issues?q=is%3Aopen"><img src="https://img.shields.io/github/issues/sebdelsol/sfvip-all?labelColor=success&style=flat-square" height="25"></a>]()

Expand All @@ -39,11 +39,13 @@ Color & pulse | Meaning

# Logs
The logs go **in pairs**, one for each process (***main*** & ***mitmproxy***).
You'll find them in the app folder:
You'll find them in the app folder[^3]:
<kbd><img src="resources/readme/logs.png"></kbd>

[^3]:The app is installed by default in `%LocalAppData%\Programs\Sfvip All x64`, `%LocalAppData%\Programs\Sfvip All x86` or the installation directory you've specified during the installation.

# Build
[![version](https://custom-icon-badges.demolab.com/badge/Build%201.4.12.42-informational?logo=github)](/build_config.py#L27)
[![version](https://custom-icon-badges.demolab.com/badge/Build%201.4.12.43-informational?logo=github)](/build_config.py#L27)
[![Sloc](https://custom-icon-badges.demolab.com/badge/Sloc%208.5k-informational?logo=file-code)](https://api.codetabs.com/v1/loc/?github=sebdelsol/sfvip-all)
[![Ruff](https://custom-icon-badges.demolab.com/badge/Ruff-informational?logo=ruff-color)](https://docs.astral.sh/ruff/)
[![Python](https://custom-icon-badges.demolab.com/badge/Python%203.11.8-linen?logo=python-color)](https://www.python.org/downloads/release/python-3118/)
Expand All @@ -56,7 +58,7 @@ You'll find them in the app folder:
* Check the [***build config***](build_config.py).

### Create the environments
You need [***Rust***](https://www.rust-lang.org/fr), [***Python 3.11 x64***](https://www.python.org/ftp/python/3.11.8/python-3.11.8-amd64.exe) & [***x86***](https://www.python.org/ftp/python/3.11.8/python-3.11.8.exe):
You need [***Rust***](https://www.rust-lang.org/fr) and [***Python 3.11 x64***](https://www.python.org/ftp/python/3.11.8/python-3.11.8-amd64.exe) & [***x86***](https://www.python.org/ftp/python/3.11.8/python-3.11.8.exe):
```console
rustup target add i686-pc-windows-msvc
py -3.11-64 -m dev.create
Expand Down
5 changes: 5 additions & 0 deletions build/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.4.12.43
* Option to modify _Sfvip All_ install directory.
* When updating the Install directory won't be asked again
and _Sfvip All_ will be automatically relaunched.

## 1.4.12.42
* Fix Minor bugs.
* Better translations.
Expand Down
6 changes: 3 additions & 3 deletions build/update_x64.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.42/Install.Sfvip.All.1.4.12.42.x64.exe",
"md5": "241815dd41f1028f1fe686e6fac8a38f",
"version": "1.4.12.42"
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.43/Install.Sfvip.All.1.4.12.43.x64.exe",
"md5": "9eec25d2ee8cb6f9916143981315f85b",
"version": "1.4.12.43"
}
6 changes: 3 additions & 3 deletions build/update_x86.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.42/Install.Sfvip.All.1.4.12.42.x86.exe",
"md5": "f783dde639168b149d22c0acc2368fe5",
"version": "1.4.12.42"
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.43/Install.Sfvip.All.1.4.12.43.x86.exe",
"md5": "4e228bc56c4bf5b10d0d7739ae0b4fee",
"version": "1.4.12.43"
}
2 changes: 1 addition & 1 deletion build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Build:
main: ClassVar = "sfvip_all.py"
company: ClassVar = "sebdelsol"
name: ClassVar = "Sfvip All"
version: ClassVar = "1.4.12.42"
version: ClassVar = "1.4.12.43"
dir: ClassVar = "build"
enable_console: ClassVar = False
logs_dir: ClassVar = "../logs"
Expand Down
62 changes: 59 additions & 3 deletions dev/tools/nsis/template.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ VIAddVersionKey "ProductName" "{{name}}"
VIAddVersionKey "CompanyName" "{{company}}"

!include "MUI2.nsh" ; modern UI
!include "FileFunc.nsh" ; GetParameters and GetOptions
Name "{{name}} {{version}} {{bitness}}"
OutFile "{{installer}}"
RequestExecutionLevel user
Expand All @@ -18,25 +19,47 @@ ShowUninstDetails hide
!define MUI_ICON "{{dist}}\{{ico}}"
!define MUI_UNICON "{{dist}}\{{ico}}"

; -------------
; directory page
; -------------
!define MUI_PAGE_CUSTOMFUNCTION_PRE "SetInstDir"
!insertmacro MUI_PAGE_DIRECTORY

; -------------
; install pages
; -------------
!define MUI_PAGE_CUSTOMFUNCTION_PRE "UninstallOldVersionIfNeeded"
Page Custom AppRunningPage AppRunningPageFinalize
!insertmacro MUI_PAGE_INSTFILES

; -------------
; finish pages
; -------------
{% if finish_page %}
Function RunApp
SetOutPath "$InstDir\{{dist}}" ; exe working directory
Exec "$InstDir\{{dist}}\{{name}}.exe"
FunctionEnd

Function AbortFinishPage
; Abort if /AUTORUN=yes
${GetParameters} $0
${GetOptions} $0 "/AUTORUN=" $1
ClearErrors
${If} $1 == "yes"
Call RunApp
Abort
${Endif}
FunctionEnd

!define MUI_PAGE_CUSTOMFUNCTION_PRE "AbortFinishPage"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "RunApp"
!insertmacro MUI_PAGE_FINISH
{% endif %}

; ---------------
; uninstall pages
; uninstall page
; ---------------
UninstPage Custom un.AppRunningPage un.AppRunningPageFinalize
!insertmacro MUI_UNPAGE_INSTFILES
Expand All @@ -56,7 +79,6 @@ LangString retry ${LANG_{{lang.upper}}} "{{lang.retry}}"
{% endfor %}

; Cmd argument /LANG= to force the language (case insensitive)
!include "FileFunc.nsh" ; GetParameters and GetOptions
!include "StrFunc.nsh" ; StrCase
${Using:StrFunc} StrCase

Expand Down Expand Up @@ -194,4 +216,38 @@ Section "Uninstall"
{% endif %}
Delete "$InstDir\uninstall.exe"
Delete "$SMPROGRAMS\{{name}} {{bitness}}.lnk"
SectionEnd
SectionEnd

; --------------
; Set install directory if in the registry
; --------------
Function SetInstDir
; check in the registry for already installed version
ReadRegStr $0 HKCU "${UNINSTALL_KEY}" "InstallLocation"
${If} ${Errors}
ClearErrors
${Else}
StrCpy $InstDir $0
${Endif}
; no directory page if /AUTOINSTDIR=yes
${GetParameters} $0
${GetOptions} $0 "/AUTOINSTDIR=" $1
ClearErrors
${If} $1 == "yes"
Abort
${Endif}
FunctionEnd

; --------------
; Uninstall version stored in the registry if different from instdir
; --------------
Function UninstallOldVersionIfNeeded
ReadRegStr $0 HKCU "${UNINSTALL_KEY}" "InstallLocation"
${If} ${Errors}
ClearErrors
${ElseIf} $InstDir != $0
${If} ${FileExists} "$0\uninstall.exe"
ExecWait "$0\uninstall.exe /S"
${EndIf}
${Endif}
FunctionEnd
8 changes: 5 additions & 3 deletions resources/README_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# <kbd><img src="{ico_link}" width="45"></kbd> {name}
***{name}*** wraps ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** to add new features:
**{name}** wraps ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** to add new features:
* Insert an _All_ category when missing so you can easily **search your entire catalog**.
<kbd><img src="resources/readme/all.png"></kbd>
* Update ***[Mpv](https://mpv.io/)*** and **Sfvip Player** so you can enjoy their latest features.
Expand Down Expand Up @@ -39,9 +39,11 @@ Color & pulse | Meaning

# Logs
The logs go **in pairs**, one for each process (***main*** & ***mitmproxy***).
You'll find them in the app folder:
You'll find them in the app folder[^3]:
<kbd><img src="resources/readme/logs.png"></kbd>

[^3]:The app is installed by default in `%LocalAppData%\Programs\{name} x64`, `%LocalAppData%\Programs\{name} x86` or the installation directory you've specified during the installation.

# Build
[![version](https://custom-icon-badges.demolab.com/badge/Build%20{build_version}-informational?logo=github)]({build_version_link})
[![Sloc](https://custom-icon-badges.demolab.com/badge/Sloc%20{sloc}-informational?logo=file-code)](https://api.codetabs.com/v1/loc/?github={github_path})
Expand All @@ -56,7 +58,7 @@ You'll find them in the app folder:
* Check the [***build config***](build_config.py).

### Create the environments
You need [***Rust***](https://www.rust-lang.org/fr), [***Python {py_major_version} x64***](https://www.python.org/ftp/python/{py_version}/python-{py_version}-amd64.exe) & [***x86***](https://www.python.org/ftp/python/{py_version}/python-{py_version}.exe):
You need [***Rust***](https://www.rust-lang.org/fr) and [***Python {py_major_version} x64***](https://www.python.org/ftp/python/{py_version}/python-{py_version}-amd64.exe) & [***x86***](https://www.python.org/ftp/python/{py_version}/python-{py_version}.exe):
```console
rustup target add i686-pc-windows-msvc
py -{py_major_version}-64 -m dev.create
Expand Down
2 changes: 1 addition & 1 deletion src/sfvip/app_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _update_exe(self, update: AppUpdate) -> Path:
def _install(self, update_exe: Path) -> None:
# replace current process with the update exe
def launch() -> None:
update_exe_args = update_exe.name, f"/LANG={LOC.language}"
update_exe_args = update_exe.name, f"/LANG={LOC.language} /AUTOINSTDIR=yes /AUTORUN=yes"
logger.info("Launch %s %s", *update_exe_args)
os.execl(update_exe, *update_exe_args)

Expand Down
5 changes: 4 additions & 1 deletion src/sfvip/ui/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,12 @@ def _app_version_tooltip(app_info: AppInfo) -> Style:
lines.extend(("", f"{prefix}{text}:"))
case "*":
lines.append(f"{tab}- {text}")
case _:
line = f"{first} {text}"
raise ValueError
except ValueError:
if line:
lines.append(f"{tab}{line}")
lines.append(f"{tab} {line}")

except (PermissionError, FileNotFoundError, OSError):
pass
Expand Down

0 comments on commit 6a1d323

Please sign in to comment.