Electron-builder: Missing Assets When Installing on Windows

Created on 4 Apr 2016  Â·  16Comments  Â·  Source: electron-userland/electron-builder

All the resources are contained in the Setup.exe. When the installer runs, I can see that all the files are Extracted, but once installed, files are missing from the /resources folder.
The missing files are .exe files, it does not seem to drop any non-.exe files.

This is happening on a 64-bit, Windows 8.1 machine.

question windows

Most helpful comment

All 16 comments

Do you use extraResources? Or what "resources" mean? Sorry, issue is not clear for me.

Oh, I use electron-packager first to create the .exe. It creates a /resources folder that includes an atom.asar and a dir with all my app files. The Setup.exe unzipped maintains the same structure.

Does extraResources work for windows now? I'm not sure that would solve my problem.

I thought at first the files were not actually being copied/installed. But it appears that the OS seems to be deleting the files shortly after they are installed. This might not be a electron-builder issue.

I use electron-packager first to create the .exe

You should not. electron-builder uses electron-packager under the hood. Please use only electron-builder.

Does extraResources work for windows now?

Yes. Confirmed by @d9k.

@turbobeast Don't think so. If you can, please share app / configs and I will try to help.

extraResources is tested and must work. Or your config is invalid.

I have not yet attempted to use extraResources. I have confirmed that the installer does copy the files over on install. But the .exe files disappear shortly thereafter.

@turbobeast I am not Squirrel.windows expert, but if you somehow copy resources to exe.... it seems you are doing it wrong. Additional resources issue is fixed in electron-builder using this option (it will be listed in the nuspec) and it is the only supported and recommended way. Other ways on your own risk and not tested/documented/supported.

@turbobeast may it be that your squirrel-aware (squirrel installer events handlers) code at the entry point of your app does some deleting?

But the .exe files disappear shortly thereafter.

which .exe do you mean? Packaged installer? Or already installed to AppData .exe? Please specify it's full path and filename, it may be useful.

I have some precompiled .exe files that I include with the other assets of my app. I thought the installer was failing to copy them over, but I realized that the OS is deleting them after they are copied over, so I have no reason to believe it is actually an issue with electron-builder. It might be solved by signing the app.

I have some .dll files in the same directory that get copied over fine, and do not randomly disappear.

I don't think it's related to the squirrel event handlers. I currently don't do anything more than. app.quit(); return true; in any of the handlers.

@turbobeast No magic. If file is not listed in the spec (https://github.com/develar/windows-installer/blob/builder/src/index.js#L125), it is not included in the nupkg and is not a part of Setup.exe.

that get copied over fine, and do not randomly disappear

because it is a part of spec *.dll.

So, solution — use extraResources.

@turbobeast thank you for clear explanation.

@turbobeast I think again and decided that current behaviour is not expected and not user-friendly.

If you somehow managed to copy precompiled .exe files to app dist folder, it should be automatically included in the nupkg.

But I still don't understand how do you copy it. electron-packager will pack it into the app exe, it will be not copied to app dist folder, right? Could you please explain — maybe you have some exclusion rules or something like that.

I am using the two package.json structure with an app/ dir. I have the binaries in the app dir with the rest of my app code and assets. Like I said, I don't use (might switch, but haven't completed that yet) electron-builder for packaging, I use electron-packager directly to package and create the -win32-ia32 folder.

Once packaged, in the -win32-ia32/resources/app folder is everything that was originally under app/ (.css, .html, .js, .dll, .exe...).

I then run electron-builder ./dist/MyApp-win32-ia32 --platform=win --out=./dist/ This creates the MyApp Setup.exe file. If I unzip MyApp Setup.exe, the inner binaries are there. When I run it (install the app) on a machine, the .exe files get copied over, but quickly disappear.

I believe the machine is deleting theme, because it considers them to a be a malware threat. I don't know this for sure, but my app is not signed.

I hope this is clear.

@turbobeast Thanks for clear explanation. electron-builder under the hood also packs app using electron-packager, so, result is not predictable.

Was this page helpful?
0 / 5 - 0 ratings