question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change the default update cache folder and default installation folder location

See original GitHub issue
  • Electron-Builder Version: 22.14.13
  • Node Version: 16.15.0
  • Electron Version: 19.0.1
  • Electron Type (current, beta, nightly): current
  • Target: windows, linux

The default folder name uses the package.json name, I want to be able to simply configure it using the api, using the appIdor a separate field

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Tarrowrencommented, Jun 7, 2022

I found the beforePack hook function and I changed the value of the metadata and it took effect. I don’t know if there are any side effects though.

beforePack: (context) => {
  context.packager.info.metadata.name = "hello";
},

app-update.yml

provider: generic
url: http://127.0.0.1:8080
useMultipleRangeRequest: false
updaterCacheDirName: hello-updater
0reactions
Tarrowrencommented, Jul 29, 2022

I browsed the source code and it will merge the content of the extraMetadata, so just configure the value of name in the extraMetadata and there is no need to use beforePack.

// packages\app-builder-lib\src\fileTransformer.ts
async function modifyMainPackageJson(file: string, extraMetadata: any, isRemovePackageScripts: boolean, isRemovePackageKeywords: boolean) {
  const mainPackageData = JSON.parse(await readFile(file, "utf-8"))
  if (extraMetadata != null) {
    // !!!
    deepAssign(mainPackageData, extraMetadata)
  }

  // https://github.com/electron-userland/electron-builder/issues/1212
  const serializedDataIfChanged = cleanupPackageJson(mainPackageData, {
    isMain: true,
    isRemovePackageScripts,
    isRemovePackageKeywords,
  })
  if (serializedDataIfChanged != null) {
    return serializedDataIfChanged
  } else if (extraMetadata != null) {
    return JSON.stringify(mainPackageData, null, 2)
  }
  return null
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Installer vs. SCCM Cache Folder - How to repair or ...
By default, this folder is set to C:\Windows\ccmcache. Important You can always change the default location of the CCMCache folder by using the ......
Read more >
Select installation locations - Visual Studio (Windows)
Specify the folder path, including the drive, where you want to store the installation files and manifests from the download cache. Important.
Read more >
Change Default Program Files Installation Directory Location
Change Default Program Files Installation Directory LocationIf you have a SSD or small Hard Drive with very little space and you want to ......
Read more >
How to change Windows Updates download folder location
The default location of Windows Update is ... The SoftwareDistribution folder is where everything gets downloaded and later installed.
Read more >
How to change your default warehouse, working directory ...
Before installing Sophos Endpoint Security and Control · Do not continue with the wizard once it opens. · Make sure that the Sophos...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found