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

how can i make progress bar please help #161

Open
Meguais opened this issue Mar 9, 2023 · 1 comment
Open

how can i make progress bar please help #161

Meguais opened this issue Mar 9, 2023 · 1 comment

Comments

@Meguais
Copy link

Meguais commented Mar 9, 2023

i cant make progress bar how can i make progressbar
can you show me
thank you

ipcMain.handle("downloadUpdate", (event, info) => {
  info.properties.onProgress = function(progress) {
      console.log('hi');
  }
  download(BrowserWindow.getFocusedWindow(), info.url, info.properties)
  .then(dl => event.sender.send("updateDownloadCompleted", dl.getSavePath()));

});

 ipcRenderer.invoke("downloadUpdate", {
  url: "http://ipv4.download.thinkbroadband.com/5MB.zip",
    properties: {
      openFolderWhenDone:true,
      showBadge:false,
      filename: 'test.zip',
      }
    });
@Muetze42
Copy link

My main.js

  ipcMain.on('download-update', () => {
    download(mainWindow, updaterBaseUrl + 'download', {
      directory: app.getPath('userData'),
      overwrite: true,
      onProgress: (status) => {
        mainWindow.webContents.send('download-update-progress', status.percent)
      }
    })
      .then((download) => {
        console.log(download.getSavePath())
        console.log(download.getFilename())
        //mainWindow.webContents.send('download-update-complete', download.getSavePath())
      })
      .catch((error) => {
        console.log(error)
      })
  })

Part in my renderer (VUE):

      electron.ipcRenderer.on('download-update-progress', (event, progress) => {
        this.updateDownloadProgress = Math.floor(progress * 100)
      })

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

No branches or pull requests

2 participants