[GH-ISSUE #741] client install dirctory select "User Application Data" in some case does not work #484

Closed
opened 2026-02-27 15:50:35 +03:00 by kerem · 2 comments
Owner

Originally created by @mwplll on GitHub (Jan 2, 2019).
Original GitHub issue: https://github.com/quasar/Quasar/issues/741

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");
            }
        }
Originally created by @mwplll on GitHub (Jan 2, 2019). Original GitHub issue: https://github.com/quasar/Quasar/issues/741 **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"); } } ```
kerem closed this issue 2026-02-27 15:50:35 +03:00
Author
Owner

@bbyte-lab commented on GitHub (Oct 10, 2019):

Thank you!

<!-- gh-comment-id:540698575 --> @bbyte-lab commented on GitHub (Oct 10, 2019): Thank you!
Author
Owner

@MaxXor commented on GitHub (May 31, 2020):

C:\Users\work\AppData\Roaming\SubDir\driver.exe is just a preview on the server. It will use the correct name on the client.

<!-- gh-comment-id:636458554 --> @MaxXor commented on GitHub (May 31, 2020): `C:\Users\work\AppData\Roaming\SubDir\driver.exe` is just a preview on the server. It will use the correct name on the client.
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#484
No description provided.