electron-archive / grunt-electron-installer

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

Can't create installer: System.Exception: Failed to modify resources, command invoked was #96

Open muhammetalay opened 8 years ago

muhammetalay commented 8 years ago

When I try to create an installer for my electron project, it fails with the following message printed to both console and SquirellSetup.log:

2016-01-14 01:15:02> Program: Starting Squirrel Updater: --releasify C:\Users\vagrant\AppData\Local\Temp\si116014-2580-1bw1390\electron-quick-start.1.0.0.nupkg --releaseDir C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\installer --loadingGif C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\node_modules\grunt-electron-installer\resources\install-spinner.gif 2016-01-14 01:15:02> Program: Bootstrapper EXE found at:C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\node_modules\grunt-electron-installer\vendor\Setup.exe 2016-01-14 01:15:02> Program: Creating release package: C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\installer\electron-quick-start.1.0.0.nupkg 2016-01-14 01:15:04> ReleasePackage: Creating release package: C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\installer\electron-quick-start.1.0.0.nupkg => C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\installer\electron-quick-start-1.0.0-full.nupkg 2016-01-14 01:15:12> ReleasePackage: Extracting dependent packages: [] 2016-01-14 01:15:12> ReleasePackage: Removing unnecessary data 2016-01-14 01:15:12> ReleasePackage: No release notes found in C:\Users\vagrant\AppData\Local\SquirrelTemp\tempa\electron-quick-start.nuspec 2016-01-14 01:15:55> Program: Building embedded zip file for Setup.exe 2016-01-14 01:16:19> Unhandled exception: System.AggregateException: One or more errors occurred. ---> System.Exception: Failed to modify resources, command invoked was: 'C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\node_modules\grunt-electron-installer\vendor\rcedit.exe "C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\installer\Setup.exe" --set-version-string "CompanyName" "GitHub" --set-version-string "LegalCopyright" "Copyright © 2016 GitHub" --set-version-string "FileDescription" "A minimal Electron application" --set-version-string "ProductName" "A minimal Electron application" --set-file-version 1.0.0 --set-product-version 1.0.0'

Output was:

at Squirrel.Update.Program.da2.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Squirrel.Update.Program.<>cDisplayClass78.b72() at Squirrel.Utility.<>cDisplayClassc.b__b() at Squirrel.Utility.Retry[T](Func`1 block, Int32 retries) at Squirrel.Utility.Retry(Action block, Int32 retries) at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi) at Squirrel.Update.Program.executeCommandLine(String[] args) at Squirrel.Update.Program.main(String[] args) ---> (Inner Exception #0) System.Exception: Failed to modify resources, command invoked was: 'C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\node_modules\grunt-electron-installer\vendor\rcedit.exe "C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app\installer\Setup.exe" --set-version-string "CompanyName" "GitHub" --set-version-string "LegalCopyright" "Copyright © 2016 GitHub" --set-version-string "FileDescription" "A minimal Electron application" --set-version-string "ProductName" "A minimal Electron application" --set-file-version 1.0.0 --set-product-version 1.0.0'

Output was:

at Squirrel.Update.Program.d__a2.MoveNext()<---

When I try to run that long rcedit command myself and see the error code, it says this:

PS C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app> C:\Users\vagrant\Desktop\Zeplin-win32-x 64\resources\app\node_modules\grunt-electron-installer\vendor\rcedit.exe "C:\Users\vagrant\Desktop\ Zeplin-win32-x64\resources\app\installer\Setup.exe" --set-version-string "CompanyName" "GitHub" --s et-version-string "LegalCopyright" "Copyright © 2016 GitHub" --set-version-string "FileDescription" "A minimal Electron application" --set-version-string "ProductName" "A minimal Electron applicatio n" --set-file-version 1.0.0 --set-product-version 1.0.0 PS C:\Users\vagrant\Desktop\Zeplin-win32-x64\resources\app> echo $lastexitcode -1073741515

It seems there is something wrong with rcedit but I don't know what. I also attached some screenshots of the computer that I'm trying this virtualbox_vagrant-getting-started_default_1452717386664_83772_14_01_2016_12_26_46 virtualbox_vagrant-getting-started_default_1452717386664_83772_14_01_2016_12_27_42

Can anyone help me on this?

muhammetalay commented 8 years ago

I tried this on a cmd window rather than powershell and this revealed that the server is missing MSVCP100.dll. Now I'm trying to fix that.

We're trying to set up a windows machine to build and package electron apps and create windows installers. Do you have any recommended setup? Which OS should we use and what programs should we install on it to make it operational?

svileng commented 8 years ago

I'm having a similar problem — it seems that rcedit fails to set the icon for the Setup.exe file.

C:\Users\IEUser\Downloads\Blink-win32-ia32>grunt create-windows-installer
Running "create-windows-installer:ia32" (create-windows-installer) task
>> System.AggregateException: One or more errors occurred. ---> System.Exception
: Failed to modify resources, command invoked was: 'C:\Users\IEUser\Downloads\Bl
ink-win32-ia32\node_modules\grunt-electron-installer\vendor\rcedit.exe "C:\Users
\IEUser\Downloads\Blink-win32-ia32\dist\Setup.exe" --set-version-string "Company
Name" "Foo Ltd" --set-version-string "LegalCopyright" "Copyright ? 20
16 Foo Ltd" --set-version-string "FileDescription" "Blink" --set-vers
ion-string "ProductName" "Blink" --set-file-version 1.0.0 --set-product-version
1.0.0 --set-icon "C:\Users\IEUser\Downloads\Blink-win32-ia32\logo.ico"'
>>
>> Output was:
>>
>>    at Squirrel.Update.Program.<setPEVersionInfoAndIcon>d__17.MoveNext()
>>    --- End of inner exception stack trace ---
>>    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCance
ledExceptions)
>>    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, Cancellatio
nToken cancellationToken)
>>    at Squirrel.Update.Program.<>c__DisplayClass9_0.<Releasify>b__10()
>>    at Squirrel.Utility.<>c__DisplayClass8_0.<Retry>b__0()
>>    at Squirrel.Utility.Retry[T](Func`1 block, Int32 retries)
>>    at Squirrel.Utility.Retry(Action block, Int32 retries)
>>    at Squirrel.Update.Program.Releasify(String package, String targetDir, Str
ing packagesDir, String bootstrapperExe, String backgroundGif, String signingOpt
s, String baseUrl, String setupIcon, Boolean generateMsi)
>>    at Squirrel.Update.Program.executeCommandLine(String[] args)
>>    at Squirrel.Update.Program.main(String[] args)
>>    at Squirrel.Update.Program.Main(String[] args)
>> ---> (Inner Exception #0) System.Exception: Failed to modify resources, comma
nd invoked was: 'C:\Users\IEUser\Downloads\Blink-win32-ia32\node_modules\grunt-e
lectron-installer\vendor\rcedit.exe "C:\Users\IEUser\Downloads\Blink-win32-ia32\
dist\Setup.exe" --set-version-string "CompanyName" "Foo Ltd" --set-ve
rsion-string "LegalCopyright" "Copyright ? 2016 Foo Ltd" --set-versio
n-string "FileDescription" "Blink" --set-version-string "ProductName" "Blink" --
set-file-version 1.0.0 --set-product-version 1.0.0 --set-icon "C:\Users\IEUser\D
ownloads\Blink-win32-ia32\logo.ico"'
>>
>> Output was:
>>
>>    at Squirrel.Update.Program.<setPEVersionInfoAndIcon>d__17.MoveNext()<---
Warning: Command failed: C:\Users\IEUser\Downloads\Blink-win32-ia32\node_modules
\grunt-electron-installer\vendor\Update.com --releasify C:\Users\IEUser\AppData\
Local\Temp\si11613-3344-1byp6rw\Blink.1.0.0.nupkg --releaseDir C:\Users\IEUser\D
ownloads\Blink-win32-ia32\dist --loadingGif C:\Users\IEUser\Downloads\Blink-win3
2-ia32\node_modules\grunt-electron-installer\resources\install-spinner.gif --set
upIcon C:\Users\IEUser\Downloads\Blink-win32-ia32\logo.ico
System.AggregateException: One or more errors occurred. ---> System.Exception: F
ailed to modify resources, command invoked was: 'C:\Users\IEUser\Downloads\Blink
-win32-ia32\node_modules\grunt-electron-installer\vendor\rcedit.exe "C:\Users\IE
User\Downloads\Blink-win32-ia32\dist\Setup.exe" --set-version-string "CompanyNam
e" "Foo Ltd" --set-version-string "LegalCopyright" "Copyright ? 2016
Foo Ltd" --set-version-string "FileDescription" "Blink" --set-version
-string "ProductName" "Blink" --set-file-version 1.0.0 --set-product-version 1.0
.0 --set-icon "C:\Users\IEUser\Downloads\Blink-win32-ia32\logo.ico"'

Output was:

   at Squirrel.Update.Program.<setPEVersionInfoAndIcon>d__17.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceled
Exceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationTo
ken cancellationToken)
   at Squirrel.Update.Program.<>c__DisplayClass9_0.<Releasify>b__10()
   at Squirrel.Utility.<>c__DisplayClass8_0.<Retry>b__0()
   at Squirrel.Utility.Retry[T](Func`1 block, Int32 retries)
   at Squirrel.Utility.Retry(Action block, Int32 retries)
   at Squirrel.Update.Program.Releasify(String package, String targetDir, String
 packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts,
String baseUrl, String setupIcon, Boolean generateMsi)
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
   at Squirrel.Update.Program.Main(String[] args)
---> (Inner Exception #0) System.Exception: Failed to modify resources, command
invoked was: 'C:\Users\IEUser\Downloads\Blink-win32-ia32\node_modules\grunt-elec
tron-installer\vendor\rcedit.exe "C:\Users\IEUser\Downloads\Blink-win32-ia32\dis
t\Setup.exe" --set-version-string "CompanyName" "Foo Ltd" --set-versi
on-string "LegalCopyright" "Copyright ? 2016 Foo Ltd" --set-version-s
tring "FileDescription" "Blink" --set-version-string "ProductName" "Blink" --set
-file-version 1.0.0 --set-product-version 1.0.0 --set-icon "C:\Users\IEUser\Down
loads\Blink-win32-ia32\logo.ico"'

I'm running the modern.ie Windows 8.1 / IE11 VM on VirtualBox for Mac: available here. The error happens even if I don't specify setupIcon in the config options:

module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    'create-windows-installer': {
      ia32: {
        appDirectory: './Blink-win32-ia32',
        outputDirectory: './dist',
        name: "Blink",
        product_name: "Blink",
        description: "Blink",
//        setupIcon: "./logo.ico",
        authors: 'Foo Ltd',
        exe: 'Blink.exe'
      }
    }
  })

  grunt.loadNpmTasks('grunt-electron-installer')
}
kappoo89 commented 8 years ago

I had the same problem. PROBLEM: [your_ appDirectory]\node_modules\grunt-electron-installer\vendor\rcedit.exe can't be executed because it's missing MSVCP100.dll SOLUTION: following this guide (http://answers.microsoft.com/en-us/windows/forum/windows_other-performance/msvcp100dll-missing/9a687c31-0619-4ee9-b511-020985e29b5f?auth=1) you can easily solve the missing file problem

havenchyk commented 8 years ago

Well, guys, could you please check, if this issue still exists?

codesmithx commented 7 years ago

I solved this by replacing the rcedit.exe with a fresh one from https://github.com/atom/node-rcedit/raw/master/bin/rcedit.exe

raybooysen commented 7 years ago

@codesmithx I've done that and my error has gone away. But how are you doing this as part of your build since it's just an exe in your node_modules?

codesmithx commented 7 years ago

I ran all my build commands from the command prompt; referencing the location of the .exe files where necessary. Somehow it just worked out

Visiopaja commented 4 months ago

My problem was, that the directory that I was running the command in had some special characters in it. I moved the project to a directory, that had no special characters and it worked fine