mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Linux: Use NSIS installer (#991)
* feat: Implement SKIP_SHORTCUT for installer * feat: Update Linux install script to use NSIS-based installer instead * feat: Wine detection for installer shortcut suppression * fix: Revert WINEPREFIX back to XDG Home Oops. * fix(linux): Forgot to use the variable here * fix(linux): Don't error if INSTALL_LOCATION exists but is empty * fix(linux): "Program Files" has a space
This commit is contained in:
@@ -178,6 +178,7 @@ namespace VRCX
|
|||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
logger.Info("{0} Starting...", Version);
|
logger.Info("{0} Starting...", Version);
|
||||||
|
logger.Debug("Wine support detection: {0}", Wine.GetIfWine());
|
||||||
|
|
||||||
ProcessMonitor.Instance.Init();
|
ProcessMonitor.Instance.Init();
|
||||||
SQLiteLegacy.Instance.Init();
|
SQLiteLegacy.Instance.Init();
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ namespace VRCX
|
|||||||
|
|
||||||
private static void Install()
|
private static void Install()
|
||||||
{
|
{
|
||||||
|
var setupArguments = "/S";
|
||||||
|
if (Wine.GetIfWine()) setupArguments += " /DISABLE_SHORTCUT=true";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.Move(Update_Executable, VRCX_Setup_Executable);
|
File.Move(Update_Executable, VRCX_Setup_Executable);
|
||||||
@@ -43,7 +46,7 @@ namespace VRCX
|
|||||||
StartInfo = new ProcessStartInfo
|
StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = VRCX_Setup_Executable,
|
FileName = VRCX_Setup_Executable,
|
||||||
Arguments = "/S",
|
Arguments = setupArguments,
|
||||||
UseShellExecute = true,
|
UseShellExecute = true,
|
||||||
WorkingDirectory = Program.AppDataDirectory
|
WorkingDirectory = Program.AppDataDirectory
|
||||||
}
|
}
|
||||||
|
|||||||
23
Dotnet/Wine.cs
Normal file
23
Dotnet/Wine.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace VRCX;
|
||||||
|
|
||||||
|
public static class Wine
|
||||||
|
{
|
||||||
|
[DllImport("ntdll.dll")]
|
||||||
|
private static extern IntPtr wine_get_version();
|
||||||
|
|
||||||
|
public static bool GetIfWine()
|
||||||
|
{
|
||||||
|
// wine_get_version should be guaranteed to exist exclusively in Wine envs,
|
||||||
|
// unlike some other suggestions like checking Wine registry keys
|
||||||
|
try
|
||||||
|
{
|
||||||
|
wine_get_version();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch { return false; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -160,6 +160,9 @@ Section "Install" SecInstall
|
|||||||
IntFmt $0 "0x%08X" $0
|
IntFmt $0 "0x%08X" $0
|
||||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRCX" "EstimatedSize" "$0"
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VRCX" "EstimatedSize" "$0"
|
||||||
|
|
||||||
|
${GetParameters} $R2
|
||||||
|
${GetOptions} $R2 /SKIP_SHORTCUT= $3
|
||||||
|
StrCmp $3 "true" +3
|
||||||
CreateShortCut "$SMPROGRAMS\VRCX.lnk" "$INSTDIR\VRCX.exe"
|
CreateShortCut "$SMPROGRAMS\VRCX.lnk" "$INSTDIR\VRCX.exe"
|
||||||
ApplicationID::Set "$SMPROGRAMS\VRCX.lnk" "VRCX"
|
ApplicationID::Set "$SMPROGRAMS\VRCX.lnk" "VRCX"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
steamapps=$HOME/.local/share/Steam/steamapps/compatdata
|
steamapps=$HOME/.local/share/Steam/steamapps/compatdata
|
||||||
stable="https://api0.vrcx.app/releases/stable/latest/download?type=zip"
|
stable="https://api0.vrcx.app/releases/stable/latest/download"
|
||||||
nightly="https://api0.vrcx.app/releases/nightly/latest/download?type=zip"
|
nightly="https://api0.vrcx.app/releases/nightly/latest/download"
|
||||||
download_url=$stable
|
download_url=$stable
|
||||||
XDG_DATA_HOME=${XDG_DATA_HOME:=$HOME/.local/share}
|
XDG_DATA_HOME=${XDG_DATA_HOME:=$HOME/.local/share}
|
||||||
|
|
||||||
@@ -61,22 +61,19 @@ fi
|
|||||||
winetricks --force -q corefonts # Workaround for https://bugs.winehq.org/show_bug.cgi?id=32342
|
winetricks --force -q corefonts # Workaround for https://bugs.winehq.org/show_bug.cgi?id=32342
|
||||||
|
|
||||||
echo "Download VRCX"
|
echo "Download VRCX"
|
||||||
|
INSTALL_LOCATION="$WINEPREFIX/drive_c/Program Files/VRCX"
|
||||||
|
|
||||||
if [[ ! -d $WINEPREFIX/drive_c/vrcx ]]; then
|
if [[ ! -d $INSTALL_LOCATION ]]; then
|
||||||
mkdir -p $WINEPREFIX/drive_c/vrcx
|
mkdir -p "$INSTALL_LOCATION"
|
||||||
else
|
else
|
||||||
rm -r $WINEPREFIX/drive_c/vrcx/*
|
rm -rf "${INSTALL_LOCATION:?}/"*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $WINEPREFIX/drive_c/vrcx
|
cd "$INSTALL_LOCATION"
|
||||||
curl -L $download_url -o vrcx.zip
|
curl -L $download_url -o vrcx_setup.exe
|
||||||
unzip -uq vrcx.zip
|
WINEPREFIX=$WINEPREFIX wine vrcx_setup.exe /S /SKIP_SHORTCUT=true
|
||||||
rm vrcx.zip
|
rm vrcx_setup.exe
|
||||||
|
|
||||||
echo "#!/usr/bin/env bash
|
|
||||||
export WINEPREFIX=$WINEPREFIX
|
|
||||||
wine $WINEPREFIX/drive_c/vrcx/VRCX.exe" > $WINEPREFIX/drive_c/vrcx/vrcx
|
|
||||||
chmod +x $WINEPREFIX/drive_c/vrcx/vrcx
|
|
||||||
|
|
||||||
echo "Install VRCX.png to $XDG_DATA_HOME/icons"
|
echo "Install VRCX.png to $XDG_DATA_HOME/icons"
|
||||||
curl -L https://raw.githubusercontent.com/vrcx-team/VRCX/master/VRCX.png -o "$XDG_DATA_HOME/icons/VRCX.png"
|
curl -L https://raw.githubusercontent.com/vrcx-team/VRCX/master/VRCX.png -o "$XDG_DATA_HOME/icons/VRCX.png"
|
||||||
@@ -86,7 +83,7 @@ echo "[Desktop Entry]
|
|||||||
Type=Application
|
Type=Application
|
||||||
Name=VRCX
|
Name=VRCX
|
||||||
Categories=Utility;
|
Categories=Utility;
|
||||||
Exec=$WINEPREFIX/drive_c/vrcx/vrcx
|
Exec=WINEPREFIX=$WINEPREFIX wine '$INSTALL_LOCATION/VRCX.exe'
|
||||||
Icon=VRCX
|
Icon=VRCX
|
||||||
" > $XDG_DATA_HOME/applications/vrcx.exe.desktop
|
" > $XDG_DATA_HOME/applications/vrcx.exe.desktop
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user