Skip to content

Commit

Permalink
Merge pull request hainproject#158 from krokofant/appref-ms-support
Browse files Browse the repository at this point in the history
ClickOnce / .appref-ms app support
  • Loading branch information
appetizermonster authored Jun 16, 2016
2 parents 70b00ef + 7e0ae0a commit 6fe07f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/main/plugins/hain-plugin-filesearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const matchFunc = (filePath, stats) => {
const ext = path.extname(filePath).toLowerCase();
if (stats.isDirectory())
return true;
return (ext === '.exe' || ext === '.lnk');
return (ext === '.exe' || ext === '.lnk' || ext === '.appref-ms');
};

function injectEnvVariable(dirPath) {
Expand Down
4 changes: 3 additions & 1 deletion app/main/plugins/hain-plugin-filesearch/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ function computeRatio(filePath) {
let ratio = 1;
const ext = path.extname(filePath).toLowerCase();
const basename = path.basename(filePath).toLowerCase();
if (ext !== '.lnk' && ext !== '.exe')
if (ext !== '.lnk' && ext !== '.exe' && ext !== '.appref-ms')
ratio *= 0.5;
if (ext === '.lnk')
ratio *= 1.5;
if (ext === '.appref-ms')
ratio *= 1.4;
if (basename.indexOf('uninstall') >= 0 || basename.indexOf('remove') >= 0)
ratio *= 0.9;
return ratio;
Expand Down
2 changes: 1 addition & 1 deletion app/main/server/app/iconprotocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function register() {
let cacheKey = filePath;
const extName = path.extname(filePath).toLowerCase();

if (extName.length > 0 && extName !== '.exe' && extName !== '.lnk') {
if (extName.length > 0 && extName !== '.exe' && extName !== '.lnk' && extName !== '.appref-ms') {
cacheKey = extName;
} else {
cacheKey = filePath;
Expand Down

0 comments on commit 6fe07f6

Please sign in to comment.