PowerISO integration question

I have a problem using commandline of PowerISO within DO.

The syntax adding files/dirs to an ISO is "-add <file/dir> /". So each selected file/folder needs an "-add" before path and " /" after. Is this possible?

What commands have you tried so far?

Hi Jon,

none, I tested to create an ISO using a video.ts-folder with following code (which works):

@set label = {dlgstring|Label der ISO-Datei:|{file|noext}}
@set name = {dlgstring|Name der ISO-Datei:|{file|noext}}
"%ProgramFiles(x86)%\PowerISO\PIso.exe" create -label {$label}.iso -o {destpath$}{$name}.iso -add {filepath$} /

But it would be great to create an ISO from all selected files.

I like PIso because it's small (not like Nero), burns everything and supports virtual drives.

No one an idea? :frowning:

If piso.exe can't take a list of names, either all on the command line one after each other or in a textfile one line per filepath, then you would need to write some kind of script to take one of those ways of listing the names and turn it into what piso.exe expects (with all the extra command line arguments and separators between the names).

Yep, but I have NO knowledge about scripting such things :frowning:

Time to learn then!

No, I wouldn't make money with it :wink: and couldn't continue my DO-iconset then!

Couldn't it be solved with a var like this:

?

No. :slight_smile: That wouldn't turn into a list of files with "-add" before each filename; it would only give you one name (the first or the last; not sure which, but it won't do what you want either way).

11 years later can someone help writing me this small script for me (add an "-add" before each filename)?

Sure. Try this and uncomment the last line, if the command looks ok.

// https://resource.dopus.com/t/poweriso-integration-question/11978

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    var dtab = clickData.func.desttab;
    var dlg = clickData.func.Dlg();
    cmd.deselect = false;

    if (tab.selected.count == 0) return;
    if (!dtab) return;
    if (String(dtab.path).substring(0, 2) == '::') return;
    
    var label = dlg.GetString('Label der ISO-Datei:', tab.selected(0).name_stem);
    if (typeof label != 'string') return;
    var name = dlg.GetString('Name der ISO-Datei:', tab.selected(0).name_stem);
    if (typeof name != 'string') return;
    
    cmd.RunCommand('Set UTILITY=otherlog');
    DOpus.ClearOutput();

    var cmdLine = '"%ProgramFiles(x86)%\\PowerISO\\PIso.exe" create -label "' + label + '.iso" -o "' + dtab.path + '\\' + name + '.iso"';

    for (var e = new Enumerator(tab.selected); !e.atEnd(); e.moveNext()) {
        var item = e.item();
        cmdLine += ' -add "' + item + '" /';
    }

    DOpus.Output(cmdLine);
    // cmd.RunCommand(cmdLine);
}
Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>11978</label>
	<icon1>#copyfilenames</icon1>
	<function type="script">
		<instruction>@script JScript</instruction>
		<instruction>// https://resource.dopus.com/t/poweriso-integration-question/11978</instruction>
		<instruction />
		<instruction>function OnClick(clickData) {</instruction>
		<instruction>    var cmd = clickData.func.command;</instruction>
		<instruction>    var tab = clickData.func.sourcetab;</instruction>
		<instruction>    var dtab = clickData.func.desttab;</instruction>
		<instruction>    var dlg = clickData.func.Dlg();</instruction>
		<instruction>    cmd.deselect = false;</instruction>
		<instruction />
		<instruction>    if (tab.selected.count == 0) return;</instruction>
		<instruction>    if (!dtab) return;</instruction>
		<instruction>    if (String(dtab.path).substring(0, 2) == &apos;::&apos;) return;</instruction>
		<instruction>    </instruction>
		<instruction>    var label = dlg.GetString(&apos;Label der ISO-Datei:&apos;, tab.selected(0).name_stem);</instruction>
		<instruction>    if (typeof label != &apos;string&apos;) return;</instruction>
		<instruction>    var name = dlg.GetString(&apos;Name der ISO-Datei:&apos;, tab.selected(0).name_stem);</instruction>
		<instruction>    if (typeof name != &apos;string&apos;) return;</instruction>
		<instruction>    </instruction>
		<instruction>    cmd.RunCommand(&apos;Set UTILITY=otherlog&apos;);</instruction>
		<instruction>    DOpus.ClearOutput();</instruction>
		<instruction />
		<instruction>    var cmdLine = &apos;&quot;%ProgramFiles(x86)%\\PowerISO\\PIso.exe&quot; create -label &quot;&apos; + label + &apos;.iso&quot; -o &quot;&apos; + dtab.path + &apos;\\&apos; + name + &apos;.iso&quot;&apos;;</instruction>
		<instruction />
		<instruction>    for (var e = new Enumerator(tab.selected); !e.atEnd(); e.moveNext()) {</instruction>
		<instruction>        var item = e.item();</instruction>
		<instruction>        cmdLine += &apos; -add &quot;&apos; + item + &apos;&quot; /&apos;;</instruction>
		<instruction>    }</instruction>
		<instruction />
		<instruction>    DOpus.Output(cmdLine);</instruction>
		<instruction>    // cmd.RunCommand(cmdLine);</instruction>
		<instruction>}</instruction>
	</function>
</button>

4 Likes

Thank you very, very much!

You are welcome.

Are you now going to "poweriso-rize" all the files and folders that have accumulated over the past decade? :smiley:

No, for my car I still use CD, so from time to time selecting new MP3s, create iso and burn all within DO now w/o using PIso gui.

But cmd doesn't work on xxx selected files, will have a look tomorrow...

Windows has a command-line length limit which you might be running into.

If you can pass the list of files to PowerIso via a text file, that should work around it.

Seems so. When selecting more than 15-20 files error "bad parameter -add" occurs.

Workaround is just selecting parent folder with the files in it.

Windows' command-line length limit is 8191 characters. Here, PowerISO seems to be overwhelmed with strings larger than appr. 1700 characters. Makes you wonder how they managed to get to version 8 with that limit :wink:

We could create the image and then edit the files in one by one.

Not necessary, just selecting parent folder is fine. Thanks.