Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default installation folder #348

Closed
OmiCron07 opened this issue Dec 6, 2019 · 33 comments
Closed

Default installation folder #348

OmiCron07 opened this issue Dec 6, 2019 · 33 comments
Assignees
Labels
Milestone

Comments

@OmiCron07
Copy link

  • Version: 7.30.2
    .Net Core 3.1
  • Target: Windows

My electron.manifest.json file :

{
  "executable": "RestroomsWatcher.MonitoringClient",
  "splashscreen": {
    "imageFile": "/Desktop/Assets/Splash.png"
  },
  "singleInstance": true,
  "build": {
    "appId": "com.RestroomsWatcher.MonitoringClient.app",
    "productName": "Restrooms Watcher",
    "copyright": "Company © 2020",
    "buildVersion": "0.9.0",
    "compression": "maximum",
    "directories": {
      "output": "../../../bin/Desktop",
      "buildResources": "Desktop/Assets"
    },
    "win": {
      "icon": "../../../Desktop/Assets/AppIcon.png"
    },
    "extraResources": [
      {
        "from": "./bin",
        "to": "bin",
        "filter": [ "**/*" ]
      }
    ],
    "files": [
      {
        "from": "./ElectronHostHook/node_modules",
        "to": "ElectronHostHook/node_modules",
        "filter": [ "**/*" ]
      },
      "**/*"
    ]
  }
}

When I build the app, I get the setup file Restrooms Watcher Setup 0.9.0.exe, but when I'm using the setup to install the application, the destination folder is ..\AppData\Local\Programs\electron.net.host. If I have two different setups, it will install in the same folder. Is it a bug or how can I change the destination folder for the application name? Is it a way too to specify another folder instead of AppData?

@OmiCron07 OmiCron07 added the bug label Dec 6, 2019
@GregorBiswanger GregorBiswanger self-assigned this Dec 6, 2019
@GregorBiswanger
Copy link
Member

Hi @OmiCron07

please see the electron-builder configuration documentation. In the electron.manifest.json file is the build-Part the 1:1 electron builder configuration-Part. Per default is NSIS as a setup ceation activated.
https://www.electron.build/configuration/nsis

Please try here the allowToChangeInstallationDirectory setting.
https://www.electron.build/configuration/nsis#NsisOptions-allowToChangeInstallationDirectory

@OmiCron07
Copy link
Author

I don't see any mention of the destination folder in their documentations. I don't want an assisted installer, just that the destination folder matches the product name and not the generic name electron.net.host.

@OmiCron07
Copy link
Author

I set up the AutoUpdate feature and there the notification :

image

Even there the name of the application is wrong.

@OmiCron07
Copy link
Author

I have found the name electron.net.host in these files :

image

So, the name is wrong but the version number is right :

image

@OmiCron07
Copy link
Author

Just discovered that Electron.App.GetNameAsync() returns electron.net.host instead of my productName.

@OmiCron07
Copy link
Author

Probably linked too :

image

The publisher's name is wrong. Instead of my company name, it displays Gregor Biswanger.

@jadhavrani123
Copy link

how can I change my installation folder name? folder name is electron.net.host replace to my project name

@jadhavrani123
Copy link

please give me a answer?I want to change folder name

@GregorBiswanger
Copy link
Member

I just tested that electron-builder doesn't just let the names and authors be configured externally. This would normally be done using the extraMetadata setting.

I will add this as a new feature for the upcoming Electron.NET version, which you can easily do in the electron.manifest.json file.

Current workaround to the solution: While you are executing the following command, for example, electronize build /target win - can you be active, before electron-builder becomes active at the end, quickly exchange the package.json with your own data. You can find the current file under PROJECTFOLDER/obj/desktop/win/package.json - write your desired name for app name and your author name there.

ElectronNet-Workaround

Please give me your feedback on whether it worked for you.

@jadhavrani123
Copy link

Thank you for responce,
I am also tried it yesterday using that solution but it not work

@jadhavrani123
Copy link

electronize build /target win I am use these command for exe folder but it is possible to create two ceperate folder for 32 bit OS & 64 bit OS

1 similar comment
@jadhavrani123
Copy link

electronize build /target win I am use these command for exe folder but it is possible to create two ceperate folder for 32 bit OS & 64 bit OS

@jadhavrani123
Copy link

Hello sir,
It is possible at the time of PC restart how can I store my EletctronNet exe in tray

@OmiCron07
Copy link
Author

Hello sir,
It is possible at the time of PC restart how can I store my EletctronNet exe in tray

To start your app automatically on Windows boot, use Electron.App.SetLoginItemSettings(new LoginSettings { OpenAtLogin = true })

@jadhavrani123
Copy link

Thank you it worked for me actually I want to store app in tray, not open directly at the time of PC restart

@jadhavrani123
Copy link

If you know answer then please help me.

Thanks in advance

@jadhavrani123
Copy link

` document.getElementById("close-btn").addEventListener("click", function (e) {
const window = remote.getCurrentWindow();
window.close();

    });`

these is the code on Close button but I want only on first time exe not close ,after second time exe will close
how I am code write for that??

@jadhavrani123
Copy link

To start your app automatically on Windows boot, use Electron.App.SetLoginItemSettings(new LoginSettings { OpenAtLogin = true });

it work for me thank you but one problem is here with application one elctron window is open how to remove it

@OmiCron07
Copy link
Author

it work for me thank you but one problem is here with application one elctron window is open how to remove it

You probably have somewhere Electron.WindowManager.CreateWindowAsync(options, loadUrl);, so you just have to remove that line.

@jadhavrani123
Copy link

Thank you it work for me

@jadhavrani123
Copy link

how can I change my installation folder name? folder name is electron.net.host replace to my project name

installation path is : C:\Users\xyz\AppData\Local\Programs\electron.net.host
but i want electron.net.host replace to my project name

@jadhavrani123
Copy link

how to restore exe to its previous position from tray and do not open multiple windows of that exe and how to restart exe on button click.

@OmiCron07
Copy link
Author

For the moment, you can't change the installation folder name, thus this issue.

To show the app, you have to call Electron.WindowManager.CreateWindowAsync(options, loadUrl); and to restore the position, just set the properties of the options parameter of the CreateWindowAsync method. To avoid opening multiple times the window, I don't know a way but by tracking when you are opening or closing the window and thus, verify yourself the state of the window before opening a new one.

@pooja6747
Copy link

Hello Sir,
Actually on click cntrl + shift + i open developer tool in my exe , but I want to close it ??

@pooja6747
Copy link

if you know answer give me response

@jadhavrani123
Copy link

var menu = new MenuItem[] {

             new MenuItem
            {
                Label = "Open",

        Click = async () => mainWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
                {
                    Width = 900,
                    Height = 700,
    }),

},

On minimize my exe store it work properly but problem is here in tray icon right click open option exe open multiple items

how to remove it please help us

On open click I want exe open only one time

@jadhavrani123
Copy link

#348 (comment)
@GregorBiswanger sir is worked for but one problem occur is here folder name is replace to project name but it shows only on my PC not on another user in another user PC is install with electron.net .host folder name
how I can change it??

@jadhavrani123
Copy link

My editor is Visual studio 2019 with Angular fronted
At the time exe package create 3 folder local , swiftshader , resources but in resources folder bin folder is create how to remove it??

@GregorBiswanger
Copy link
Member

You can set a name and author of the app in electron.manifest.json with the new Electron.NET Version 8.31.1

As example:

{
  "executable": "ElectronNet8311",
  "splashscreen": {
    "imageFile": "/wwwroot/assets/electronnet-splashscreen-2.jpg"
  },
  "name": "ElectronNet8311",
  "author": "Max Mustermann",
  "description": "voll my app",
  "singleInstance": false,
  "build": {
    "appId": "com.ElectronNet8311.app",
    "productName": "ElectronNet8311",
    "copyright": "Copyright © 2020",
    "buildVersion": "1.0.0",
    "compression": "maximum",
    "directories": {
      "output": "../../../bin/Desktop"
    },
    "extraResources": [
      {
        "from": "./bin",
        "to": "bin",
        "filter": ["**/*"]
      }
    ],
    "files": [
      {
        "from": "./ElectronHostHook/node_modules",
        "to": "ElectronHostHook/node_modules",
        "filter": ["**/*"]
      },
      "**/*"
    ]
  }
}

@kristianklok
Copy link

kristianklok commented Dec 18, 2020

I don't see any mention of the destination folder in their documentations. I don't want an assisted installer, just that the destination folder matches the product name and not the generic name electron.net.host.

@OmiCron07 Sorry for necro'ing this thread. Did you ever find a solution to this? I have been looking into this all day and it appears that two ElectronNet applications using unassisted installers cannot co-exist on the same (Windows) system. Even if they are from different vendors?

@OmiCron07
Copy link
Author

I don't see any mention of the destination folder in their documentations. I don't want an assisted installer, just that the destination folder matches the product name and not the generic name electron.net.host.

@OmiCron07 Sorry for necro'ing this thread. Did you ever find a solution to this? I have been looking into this all day and it appears that two ElectronNet applications using unassisted installers cannot co-exist on the same (Windows) system. Even if they are from different vendors?

I didn't come back to the app I made with Electron.Net and I didn't test version 8.31.1 either for the new installation folder name. I suggest you open a new issue for your problem, sorry that I can't help much.

@HJST1979
Copy link

HJST1979 commented Feb 4, 2021

Example for "Default installation folder" write this in electron.manifest.json

"build": {
"appId": "com..app",
"productName": "",
"copyright": "Copyright © 2021",
"buildVersion": "1.0.0",
"compression": "maximum",
"win": {
"icon": "../../../.ico"
},
"nsis" : {
"oneClick" : false,
"multiLanguageInstaller" : true,
"allowToChangeInstallationDirectory" : true
},

.....

@gsobrinhodev
Copy link

gsobrinhodev commented Sep 18, 2023

Friends,

It's possible we have the installation on default directory but with my App name? Instead electron.net.host ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants