[PR #742] [CLOSED] fix client install directory bug in particular case #1181

Closed
opened 2026-02-27 15:53:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/quasar/Quasar/pull/742
Author: @mwplll
Created: 1/2/2019
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • dbe7a77 use 'Common Application Data' replace 'User Application Data' as Client install directory to fix bug in particular case

📊 Changes

3 files changed (+3 additions, -3 deletions)

View changed files

📝 Quasar.Server/Build/ClientBuilder.cs (+1 -1)
📝 Quasar.Server/Forms/FrmBuilder.Designer.cs (+1 -1)
📝 Quasar.Server/Forms/FrmBuilder.cs (+1 -1)

📄 Description

use 'Common Application Data' replace 'User Application Data' as Client install directory to fix bug in particular case

https://github.com/quasar/QuasarRAT/issues/741#issue-395170419

Describe the bug
in Client Builder,select "User Application Data" as client install directory,when the server's system login account not exist in client,it does not work.

System

  • Server OS: Windows 10,system account:work
  • Client OS: Windows 7,system account:Administrator
  • Quasar Version: 1.3.0

To Reproduce
Steps to reproduce the behavior:

  1. quasar.exe->builder->Installation Settings
  2. install directory select 'User Application Data'
  3. when the Server's login account is 'work',the client install directory become 'C:\Users\work\AppData\Roaming\SubDir\driver.exe'
  4. then run client.exe in Client which not has work account ,the client.exe not install

bug code

  • Quasar.Server\Forms\FrmBuilder.cs
        private void RefreshPreviewPath()
        {
            string path = string.Empty;
            if (rbAppdata.Checked)
                path =
                    Path.Combine(
                        Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                            txtInstallSubDirectory.Text), txtInstallName.Text);
            else if (rbProgramFiles.Checked)
                path =
                    Path.Combine(
                        Path.Combine(
                            Environment.GetFolderPath(PlatformHelper.Is64Bit
                                ? Environment.SpecialFolder.ProgramFilesX86
                                : Environment.SpecialFolder.ProgramFiles), txtInstallSubDirectory.Text), txtInstallName.Text);
            else if (rbSystem.Checked)
                path =
                    Path.Combine(
                        Path.Combine(
                            Environment.GetFolderPath(PlatformHelper.Is64Bit
                                ? Environment.SpecialFolder.SystemX86
                                : Environment.SpecialFolder.System), txtInstallSubDirectory.Text), txtInstallName.Text);

            this.Invoke((MethodInvoker)delegate { txtPreviewPath.Text = path + ".exe"; });
        }

        private short GetInstallPath()
        {
            if (rbAppdata.Checked) return 1;
            if (rbProgramFiles.Checked) return 2;
            if (rbSystem.Checked) return 3;
            throw new ArgumentException("InstallPath");
        }
  • Quasar.Server\Build\ClientBuilder.cs
        private sbyte GetSpecialFolder(int installpath)
        {
            switch (installpath)
            {
                case 1:
                    return (sbyte)Environment.SpecialFolder.ApplicationData;
                case 2:
                    return (sbyte)Environment.SpecialFolder.ProgramFilesX86;
                case 3:
                    return (sbyte)Environment.SpecialFolder.SystemX86;
                default:
                    throw new ArgumentException("InstallPath");
            }
        }

fix suggestion
use CommonApplicationData replace ApplicationData

  • Quasar.Server\Forms\FrmBuilder.cs
        private void RefreshPreviewPath()
        {
            string path = string.Empty;
            if (rbAppdata.Checked)
                path =
                    Path.Combine(
                        Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
                            txtInstallSubDirectory.Text), txtInstallName.Text);
            else if (rbProgramFiles.Checked)
                path =
                    Path.Combine(
                        Path.Combine(
                            Environment.GetFolderPath(PlatformHelper.Is64Bit
                                ? Environment.SpecialFolder.ProgramFilesX86
                                : Environment.SpecialFolder.ProgramFiles), txtInstallSubDirectory.Text), txtInstallName.Text);
            else if (rbSystem.Checked)
                path =
                    Path.Combine(
                        Path.Combine(
                            Environment.GetFolderPath(PlatformHelper.Is64Bit
                                ? Environment.SpecialFolder.SystemX86
                                : Environment.SpecialFolder.System), txtInstallSubDirectory.Text), txtInstallName.Text);

            this.Invoke((MethodInvoker)delegate { txtPreviewPath.Text = path + ".exe"; });
        }

        private short GetInstallPath()
        {
            if (rbAppdata.Checked) return 1;
            if (rbProgramFiles.Checked) return 2;
            if (rbSystem.Checked) return 3;
            throw new ArgumentException("InstallPath");
        }
  • Quasar.Server\Build\ClientBuilder.cs
        private sbyte GetSpecialFolder(int installpath)
        {
            switch (installpath)
            {
                case 1:
                    return (sbyte)Environment.SpecialFolder.CommonApplicationData;
                case 2:
                    return (sbyte)Environment.SpecialFolder.ProgramFilesX86;
                case 3:
                    return (sbyte)Environment.SpecialFolder.SystemX86;
                default:
                    throw new ArgumentException("InstallPath");
            }
        }

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/quasar/Quasar/pull/742 **Author:** [@mwplll](https://github.com/mwplll) **Created:** 1/2/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`dbe7a77`](https://github.com/quasar/Quasar/commit/dbe7a7784b00d5a6fcba0a3a5d67ec5d2cddd984) use 'Common Application Data' replace 'User Application Data' as Client install directory to fix bug in particular case ### 📊 Changes **3 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `Quasar.Server/Build/ClientBuilder.cs` (+1 -1) 📝 `Quasar.Server/Forms/FrmBuilder.Designer.cs` (+1 -1) 📝 `Quasar.Server/Forms/FrmBuilder.cs` (+1 -1) </details> ### 📄 Description **use 'Common Application Data' replace 'User Application Data' as Client install directory to fix bug in particular case** [https://github.com/quasar/QuasarRAT/issues/741#issue-395170419](https://github.com/quasar/QuasarRAT/issues/741#issue-395170419) **Describe the bug** in Client Builder,select "User Application Data" as client install directory,when the server's system login account not exist in client,it does not work. **System** - Server OS: Windows 10,system account:work - Client OS: Windows 7,system account:Administrator - Quasar Version: 1.3.0 **To Reproduce** Steps to reproduce the behavior: 1. quasar.exe->builder->Installation Settings 2. install directory select 'User Application Data' 3. when the Server's login account is 'work',the client install directory become 'C:\Users\work\AppData\Roaming\SubDir\driver.exe' 4. then run client.exe in Client which not has work account ,the client.exe not install **bug code** - Quasar.Server\Forms\FrmBuilder.cs ``` private void RefreshPreviewPath() { string path = string.Empty; if (rbAppdata.Checked) path = Path.Combine( Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), txtInstallSubDirectory.Text), txtInstallName.Text); else if (rbProgramFiles.Checked) path = Path.Combine( Path.Combine( Environment.GetFolderPath(PlatformHelper.Is64Bit ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles), txtInstallSubDirectory.Text), txtInstallName.Text); else if (rbSystem.Checked) path = Path.Combine( Path.Combine( Environment.GetFolderPath(PlatformHelper.Is64Bit ? Environment.SpecialFolder.SystemX86 : Environment.SpecialFolder.System), txtInstallSubDirectory.Text), txtInstallName.Text); this.Invoke((MethodInvoker)delegate { txtPreviewPath.Text = path + ".exe"; }); } private short GetInstallPath() { if (rbAppdata.Checked) return 1; if (rbProgramFiles.Checked) return 2; if (rbSystem.Checked) return 3; throw new ArgumentException("InstallPath"); } ``` - Quasar.Server\Build\ClientBuilder.cs ``` private sbyte GetSpecialFolder(int installpath) { switch (installpath) { case 1: return (sbyte)Environment.SpecialFolder.ApplicationData; case 2: return (sbyte)Environment.SpecialFolder.ProgramFilesX86; case 3: return (sbyte)Environment.SpecialFolder.SystemX86; default: throw new ArgumentException("InstallPath"); } } ``` **fix suggestion** use CommonApplicationData replace ApplicationData - Quasar.Server\Forms\FrmBuilder.cs ``` private void RefreshPreviewPath() { string path = string.Empty; if (rbAppdata.Checked) path = Path.Combine( Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), txtInstallSubDirectory.Text), txtInstallName.Text); else if (rbProgramFiles.Checked) path = Path.Combine( Path.Combine( Environment.GetFolderPath(PlatformHelper.Is64Bit ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles), txtInstallSubDirectory.Text), txtInstallName.Text); else if (rbSystem.Checked) path = Path.Combine( Path.Combine( Environment.GetFolderPath(PlatformHelper.Is64Bit ? Environment.SpecialFolder.SystemX86 : Environment.SpecialFolder.System), txtInstallSubDirectory.Text), txtInstallName.Text); this.Invoke((MethodInvoker)delegate { txtPreviewPath.Text = path + ".exe"; }); } private short GetInstallPath() { if (rbAppdata.Checked) return 1; if (rbProgramFiles.Checked) return 2; if (rbSystem.Checked) return 3; throw new ArgumentException("InstallPath"); } ``` - Quasar.Server\Build\ClientBuilder.cs ``` private sbyte GetSpecialFolder(int installpath) { switch (installpath) { case 1: return (sbyte)Environment.SpecialFolder.CommonApplicationData; case 2: return (sbyte)Environment.SpecialFolder.ProgramFilesX86; case 3: return (sbyte)Environment.SpecialFolder.SystemX86; default: throw new ArgumentException("InstallPath"); } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:53:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Quasar#1181
No description provided.