Skip to content

Commit

Permalink
autodownload cabextract (required winetricks)
Browse files Browse the repository at this point in the history
  • Loading branch information
hitman249 committed Jun 22, 2023
1 parent 0f617e4 commit 252bb43
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
Binary file added bin/cabextract
Binary file not shown.
5 changes: 5 additions & 0 deletions src/src/modules/app-folders.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default class AppFolders {
squashfuseFile = '/bin/squashfuse';
dosboxFile = '/bin/dosbox';
fuseisoFile = '/bin/fuseiso';
cabextractFile = '/bin/cabextract';
libsDir = '/bin/libs/i386';
libs64Dir = '/bin/libs/x86-64';
shareDir = '/bin/share';
Expand Down Expand Up @@ -277,6 +278,10 @@ export default class AppFolders {
return this.getRootDir() + this.fuseisoFile;
}

getCabextractFile() {
return this.getRootDir() + this.cabextractFile;
}

getResolutionsFile() {
return this.getRootDir() + this.resolutionsFile;
}
Expand Down
1 change: 1 addition & 0 deletions src/src/modules/kernels/wine.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export default class Wine extends AbstractWine {

return this.update.downloadWinetricks()
.then(() => this.fs.exists(path) ? null : Promise.reject())
.then(() => this.update.downloadCabextract())
.then(() => {
api.commit(action.get('logs').CLEAR);

Expand Down
16 changes: 15 additions & 1 deletion src/src/modules/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fs = require('fs');

export default class Update {

version = '1.5.19';
version = '1.5.20';

/**
* @type {string}
Expand Down Expand Up @@ -118,6 +118,20 @@ export default class Update {
return Promise.resolve();
}

/**
* @returns {Promise}
*/
downloadCabextract() {
let url = this.network.getRepo('/bin/cabextract');
let path = this.appFolder.getCabextractFile();

if (!this.fs.exists(path)) {
return this.network.download(url, path);
}

return Promise.resolve();
}

/**
* @return {string}
*/
Expand Down
1 change: 1 addition & 0 deletions src/src/modules/wine-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default class WineCommand extends Command {

let exported = {
VK_LAYER_PATH: `$VK_LAYER_PATH:${this.appFolders.getCacheImplicitLayerDir()}`,
PATH: `$PATH:${this.appFolders.getBinDir()}`,
XDG_CACHE_HOME: this.appFolders.getCacheDir(),
WINE: wine.getWineBin(),
WINE64: wine.getWine64Bin(),
Expand Down

0 comments on commit 252bb43

Please sign in to comment.