PhoenicisOrg/scripts

vcrun6sp6 crash

Zemogiter opened this issue · 16 comments

When attempting to remove stdole2.dll file the verb crashes

Extracting to: /home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/vcrun6sp6/
Extracting cabinet: /home/jonasz/.Phoenicis/resources///Vs6sp6.exe
  extracting vcredist.exe

All done, no errors.
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/stdole2.dll" does not exist
	at org.phoenicis.tools.files.FileUtilities.remove(FileUtilities.java:165)
	at <js> remove(Unnamed:101:2143-2172)
	at <js> go(Unnamed:38:1348-1389)
	at <js> install(Unnamed:52:1766-1789)
	at org.graalvm.polyglot.Value.invokeMember(Value.java:459)
	at org.phoenicis.engines.VerbsManager.lambda$installVerb$0(VerbsManager.java:71)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by host exception: java.lang.IllegalArgumentException: Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/stdole2.dll" does not exist

[WARNING] 
org.graalvm.polyglot.PolyglotException: Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/stdole2.dll" does not exist
    at org.phoenicis.tools.files.FileUtilities.remove (FileUtilities.java:165)
    at <js>.remove (Unnamed:101)
    at <js>.go (Unnamed:38)

I've looked and there really is no such file.

plata commented

Could it be that the file was part of Wine before? Or is it stdole2.tlb?

@Gcenx do you maybe know something about this?

plata commented

Actually, winetricks is using stdole2.tlb.
See Winetricks/winetricks#1154 and https://github.com/Winetricks/winetricks/blob/94edaddc039c205a98c2a620399a741c7a70ce02/src/winetricks#L11789. I think we simply should change the Verb such that it matches winetricks again.

Gcenx commented

I don’t recognize the file but winetricks is listing it as a fakedll, so I’m assuming it is part of wine these days

Please reopen because it still crashes but this time it complains about comcat.dll not existing and when browsed the system32 directory I confirm it really isn't there.

[WARNING] 
org.graalvm.polyglot.PolyglotException: Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/comcat.dll" does not exist
    at org.phoenicis.tools.files.FileUtilities.remove (FileUtilities.java:165)
    at <js>.remove (Unnamed:101)
    at <js>.go (Unnamed:34)
    at <js>.install (Unnamed:52)
    at org.graalvm.polyglot.Value.invokeMember (Value.java:459)
    at org.phoenicis.engines.VerbsManager.lambda$installVerb$0 (VerbsManager.java:71)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)
plata commented

This is weird. It complained about stdole2 first so comcat must have existed (otherwise it would not even have reached this point).

winetricks use w_try rm, so you should check the file exists before trying to remove it. I would suggest adding the fileExists check inside remove to get rid of this permanently.

Please reopen (again) I got a error:

Extracting to: /home/jonasz/.Phoenicis/containers//wineprefix//Heroes of Might  Magic IV//drive_c/vcrun6sp6/
Extracting cabinet: /home/jonasz/.Phoenicis/resources///Vs6sp6.exe
  extracting vcredist.exe

All done, no errors.
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: Cannot read property 'split' of undefined
	at <js> run(Unnamed:387:14404-14419)
	at <js> run(Unnamed:172:5961-6051)
	at <js> go(Unnamed:42:1481-1529)
	at <js> install(Unnamed:52:1766-1789)
	at org.graalvm.polyglot.Value.invokeMember(Value.java:459)
	at org.phoenicis.engines.VerbsManager.lambda$installVerb$0(VerbsManager.java:71)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

[WARNING] 
org.graalvm.polyglot.PolyglotException: TypeError: Cannot read property 'split' of undefined
    at <js>.run (Unnamed:387)
    at <js>.run (Unnamed:172)
    at <js>.go (Unnamed:42)
    at <js>.install (Unnamed:52)
    at org.graalvm.polyglot.Value.invokeMember (Value.java:459)
    at org.phoenicis.engines.VerbsManager.lambda$installVerb$0 (VerbsManager.java:71)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)
plata commented

It's in

const extensionFile = executable.split(".").pop();

Can you check the value of setupFile before
this.wine.run(setupFile, "/q", null, false, true);
?

I forgot how. But I tried the setupFile in plain wine and it failed:

002c:fixme:ole:DllRegisterServer stub
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0

Update: I've replaced setupFile in run with a directory path and it solved the problem.

plata commented

Update: I've replaced setupFile in run with a directory path and it solved the problem.

This doesn't make sense for me.

Just:

print("setupFile: " + setupFile);
this.wine.run(setupFile, "/q", null, false, true); 

@plata print reports setupFile as undefined. Dosen't make sense to me.

plata commented

I kinda expected this. Seems that something's going wrong with CabExtract.

plata commented

Ok, CabExtract does not return anything. It's used wrongly:

const setupFile = new CabExtract()

Should be (untested):

const setupDir = `${prefixDirectory}/drive_c/vcrun6sp6/`;
new CabExtract()
      .wizard(wizard)
      .archive(toBeCabExtracted)
      .to(setupDir)
      .extract(["-L", "-F", "vcredist.exe"]);
const setupFile = setupDir + "vcredist.exe";

I've tested it and it works.

Does it maybe make sense to change the contract of CabExtract#extract to return an array of path strings? I.e. the extracted files/folders? Is this possible?

plata commented

I don't think it's possible. At least not easily. You could use the "-l" parameter of cabextract to list the files but then you would have to parse the cabextract output.