Here is a JavaScript example to get the filename and icon path, I did it myself. But this is simplistic, I don't know how it will work with paths, and also there is no version number import and stuff.
Code: Select all
function ExeFindSource(pFile, pExt) {
var pTmp = AkelPad.ReadFile(pFile);
var Pos1 = pTmp.indexOf('; Executable = ')
if (Pos1 != -1)
{
Pos1 += 15 // pStart.length
var Pos2 = pTmp.indexOf('.' + pExt, Pos1)
if (Pos2 != -1)
{
pTmp = pTmp.substring(Pos1, Pos2 + 4)
pTmp = sFileDir + '\\' + pTmp
return pTmp
}
}
return sFileWiExt + pExt
}
function IconFindSource(pFile) {
var pTmp = AkelPad.ReadFile(pFile);
var Pos1 = pTmp.indexOf('; UseIcon = ')
if (Pos1 != -1)
{
Pos1 += 12 // pStart.length
var Pos2 = pTmp.indexOf('.ico', Pos1)
if (Pos2 != -1)
{
pTmp = pTmp.substring(Pos1, Pos2 + 4)
var fso = new ActiveXObject("Scripting.FileSystemObject");
pTmp = sFileDir + '\\' + pTmp
if (fso.FileExists(pTmp))
{
pTmp = ' /ICON "' + pTmp + '"'
} else {
pTmp = ''
}
}
}
return pTmp
}