Skip to content

Commit a76c7df

Browse files
author
Juan Segura
committed
v1.0.0-beta2
- Bug in ZXBSInstall installation bash
1 parent 675a39e commit a76c7df

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

ZXBSInstaller.Log/ServiceLayer.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,17 +1073,35 @@ echo on
10731073
bashFile = Path.Combine(GeneralConfig.BasePath, "downloads", "zxbsinstall.sh");
10741074
bash = @"
10751075
#!/bin/bash
1076+
set -e
10761077
10771078
echo ""Updating installer...""
10781079
sleep 5
10791080
1080-
set -x
1081-
tar -xf ""{tempFile}"" -C ""{installationPath}""
1082-
rm -f ""{tempFile}""
1083-
cd ""{installationPath}"" || exit 1
1084-
1085-
# Ejecutar sin esperar (en segundo plano)
1086-
./ZXBSInstaller.exe &";
1081+
ZIP_FILE=""{tempFile}""
1082+
DEST_DIR=""{installationPath}""
1083+
1084+
extract_zip() {
1085+
if command -v unzip >/dev/null 2>&1; then
1086+
echo ""Using unzip...""
1087+
unzip -o ""$ZIP_FILE"" -d ""$DEST_DIR""
1088+
elif command -v tar >/dev/null 2>&1; then
1089+
echo ""Using tar...""
1090+
tar -xf ""$ZIP_FILE"" -C ""$DEST_DIR""
1091+
else
1092+
echo ""Error: Neither unzip nor tar is installed.""
1093+
exit 1
1094+
fi
1095+
}
1096+
1097+
extract_zip
1098+
1099+
rm -f ""$ZIP_FILE""
1100+
cd ""$DEST_DIR"" || exit 1
1101+
1102+
# Ejecutar sin esperar
1103+
./ZXBSInstaller &
1104+
";
10871105
}
10881106
bash = bash.Replace("{tempFile}", tempFile).Replace("{installationPath}", installationPath);
10891107
File.WriteAllText(bashFile, bash);

ZXBSInstaller/ZXBSInstaller.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ApplicationManifest>app.manifest</ApplicationManifest>
77
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
88
<ApplicationIcon>zxbs.ico</ApplicationIcon>
9-
<Version>1.0.0.1</Version>
9+
<Version>1.0.0.2</Version>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<None Remove="Assets\install.svg" />

0 commit comments

Comments
 (0)