Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "file reference 'mainExecutableFile' not defined" #19

Open
stretchkennedy opened this issue Apr 7, 2021 · 0 comments
Open

Getting "file reference 'mainExecutableFile' not defined" #19

stretchkennedy opened this issue Apr 7, 2021 · 0 comments

Comments

@stretchkennedy
Copy link

stretchkennedy commented Apr 7, 2021

In #8 an optional flag --run-after/-r flag was added. This adds a CustomAction that is always added, even if runAfter isn't set:

      el('CustomAction', {
	    Id: "LaunchInstalledExe",
	    FileKey: "mainExecutableFile", // what goes here?
	    ExeCommand: "",                // and here?
	    Execute: "immediate",
	    Impersonate: "yes",
	    Return: "asyncNoWait"
      }),

The line FileKey: "mainExecutableFile" causes the following error for me (on Win 10):

<redacted>/node_modules/msi-packager/cli.js:80
  if (err) throw err
           ^

Error: Command failed: wixl /tmp/msi-packager202137-26063-1f0w89q.iyx7 -o <redacted>/release/setup.msi

(wixl:26074): GLib-GObject-WARNING **: 20:09:22.947: g_object_set_is_valid_property: object class 'WixlWixProperty' has no property named 'Secure'

(wixl:26074): wixl-ERROR **: 20:09:22.947: builder.vala:1076: file reference 'mainExecutableFile' not defined

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  killed: false,
  code: null,
  signal: 'SIGTRAP',
  cmd: 'wixl /tmp/msi-packager202137-26063-1f0w89q.iyx7 -o <redacted>/setup.msi'
}

I believe this is happening because that block of code adds a FileReference to mainExecutableFile, which causes wixl to throw an error if that file doesn't exist.

I'm not really sure what the proper fix is here - I'm unable to get --run-after to run the installed executable, so I can't test. In a few minutes I'll put up a PR which doesn't defined LaunchInstalledExe unless runAfter is set, which should be a safe way to isolate these problems to --run-after. However, I'd appreciate some help debugging --run-after and checking whether the entire CustomAction can be removed, since there's another CustomAction defined above that seems to do the actual running of the executable and since the LaunchInstalledExe ID isn't used anywhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant