electron-archive / grunt-electron-installer

Grunt plugin to build Windows installers for Electron apps
MIT License
402 stars 106 forks source link

Having trouble with creating installer on Ubuntu 15.10 #98

Open pkkummermo opened 8 years ago

pkkummermo commented 8 years ago

I'm getting an error on both the 32-bit and 64-bit installer when trying to run them on a Win10 x64 machine.

The main culprint seems to be on this line IEnableLogger: Failed to create uninstaller registry entry: System.Xml.XmlException: Koden Default krever et Extension-attributt som ikke er tomt

The line "Koden Default krever et Extension-attributt som ikke er tomt" is localized and I'm guessing it's something in the line of "Code Default requires an Extension-attribute which isn't empty".

If you want me to paste the whole error log I can, but it seems that everything looks OK until this point.

Jaykah commented 8 years ago

Having the same issue on

Jaykah commented 8 years ago

Tried Mono 4.0.5.1 - no luck either.

pkkummermo commented 8 years ago

Same issue trying to install on Win7 32-bit

bendiksolheim commented 8 years ago

Sooo, after some intensive googling it seems to me that the file named [Content_Types].xml inside the generated .nupkg file might be the cause. It contains the line

<Default ContentType="application/octet" Extension="" />

which seems to be the cause of this problem. The exact error in english is:

IEnableLogger: Failed to create uninstaller registry entry: System.Xml.XmlException: 'Default' tag requires a nonempty 'Extension' attribute. Line 10, position 4.

This is a generated file, and my guess is that there is some file without a file ending that is causing this line to be generated. I have yet to find out which file though.

bendiksolheim commented 8 years ago

I removed the LICENSE file from the electron build, and also removed the line

<file src="LICENSE" target="lib\net45\LICENSE" />

from template.nuspec. Everything build just fine, and the offending line in [Content_Types].xml is gone. I no longer get the error when installing, but now the installation just fails silently instead. It seems to install some of the files to my AppData folder, among others the executable. Running the executable does not work, it complains on some javascript files missing. This leads me to believe that the installation failed before it could copy all the files into AppData.

bendiksolheim commented 8 years ago

I have given up getting this to work on Linux. I am able to create working installers on Windows, so that will have to do for now.

tomkel commented 8 years ago

+1, I have the same issue. Like @bendiksolheim I have worked around it by building on Windows.

Seems to be related to #101.

bendiksolheim commented 8 years ago

There are, I think, multiple problems here:

The first one can be battled by editing the template.nuspec (see comment 6), but I have not found a way to fix the other issue.

bendiksolheim commented 8 years ago

Further investigations: the .nupkg file is different depending on the platform you build on. When building on Windows, my application is located in lib/net45/resources inside the .nupkg-file, but this folder is missing when I build on Linux and Mac OS. I have no idea if this is because of Mono or grunt-electron-installer though.

EDIT: I have looked through the code in this library, and it seems to me that it just proxies to Squirrel in the end. The file which is run in the end is Update-Mono.exe (which I believe is a file from Squirrel) with a bunch of options, one being the nupkg-file. This might mean that the error is in Squirrel. I am nowhere near sure about this though, I don't really have too much time to investigate at the moment.

havenchyk commented 8 years ago

@bendiksolheim could you please try with https://github.com/electronjs/windows-installer/pull/36 ? I believe I solves the issue, but I need a confirm from anybody, since there is no tests to support cross platform.

bendiksolheim commented 8 years ago

@havenchyk I can see it has already been merged, but I can confirm that this indeed does bundle the resources folder and locales folder in the nupkg file (and therefore also the setup file, I would guess). I have not tried to install it yet (lacking a Windows computer atm), but I would be surprised if it didn't work as this was the exact problem earlier.

I have made the same changes locally in the template.nuspec file in grunt-electron-installer, and it seems to work here as well. It does not fix the problem with the empty extension though:

<Default ContentType="application/octet" Extension="" />
havenchyk commented 8 years ago

@bendiksolheim could you try once again? I believe it has been fixed with https://github.com/electron/windows-installer/pull/49 If you still have this problem, please, create the issue on electron/windows-installer

bendiksolheim commented 8 years ago

@havenchyk I'll be sure to try it once I get the opportunity. I am traveling at the moment though, so I don't have any time before the end of the next week.

Thank you for taking the time to report back :)

bendiksolheim commented 8 years ago

Sorry about the long delay here. I just tested it, and it does indeed package the missing files now :) But it does not fix the problem with the empty extension. I still have this line in my [Content_Types].xml:

<Default ContentType="application/octet" Extension="" />

Unsure if that is an issue though. It seems to be an issue with mono itself, and not grunt-electron-installer.