question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated Windows Installer (MSI) does not preserve source App Directory Structure

See original GitHub issue

Hi Guys,

First of all, thanks for developing/providing electron-wix-msi to the Electron community. I think I was lucky to find this module. It looks promising!

On the other hand, I think I have found an issue that needs to be addressed by electron-wix-msi module. According docs for Application Distribution on Electron Documentation, the standard way to prepare an Electron app for distribution is to have the following directory structure, for example:

electron/resources/app
|____ package.json
|____ main.js
|____ index.html

So, I prepared my Electron app with such directory structure and provided the path of root “electron” directory to electron-wix-msi module, for example:

import { MSICreator } from 'electron-wix-msi';
const msiCreator = new MSICreator({
  appDirectory: '/path/to/electron/directory',
  ...
});
...

The electron-wix-msi module successfully generated the Windows Installer file (MSI). The problem I found is that after I setup the application using the generated Windows Installer, all sub-directories under provided source App Directory (‘/path/to/electron/directory’, including the resources/app directory) seem to have gone in the Application installed under “Program Files” directory. Instead, all files contained under source App Directory seem to have been placed in a single/flattened directory under the corresponding “Program Files” directory. We are using latest release of electron-wix-msi module (v1.3.0).

Please confirm if this is an issue that can be fixed in a future version of electron-wix-msi module. In my humble opinion, this problem is related to the generated intermediate WXS file, as the components under “Program Files” directory should preserve source App Directory Structure.

So far, it looks like this is the only show-stopper issue that is impeding us to use electron-wix-msi module in the way is intended to be used. In case this issue can be fixed on electron-wix-msi module, could you provide an ETA on when would it be fixed? Sorry for asking about that but we are eager to go ahead with electron-wix-msi module and continue using it as part of the tooling we have in place for our Electron applications.

Sorry for long description! I just wanted to ensure the issue is well documented. Thanks again for electron-wix-msi module!

Thanks, Anibal

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
silviosancommented, May 1, 2018

Hi Anibal,

I had a similar problem with the electron-wix-module and found a solution that works for my setup: I had to use a fully qualified path for the ‘appDirectory’ property of the MSICreator. e.g. for Windows something like this: appDirectory: ‘C:/Users/yourname/Documents/appname/dist/win-unpacked’

‘win-unpacked’ is the output-folder of the packager-tool I used.

Important: Don’t use trailing slashes and no relative paths.

Maybe that solves your problem, too?!

Cheers, Silvio

2reactions
ghostcommented, May 7, 2018

Just as tip to future visitors: you can also use (assuming run from app’s root directory):

...
"appDirectory": require("path").join(__dirname, "dist/win-unpacked"),
...

This way you can avoid hard-coded paths in case you need to distribute the build script source.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated Windows Installer (MSI) does not preserve source ...
The problem I found is that after I setup the application using the generated Windows Installer, all sub-directories under provided source App ......
Read more >
Specifying Directory Structure - Win32 apps - Microsoft Learn
The installer keeps information about the installation directory structure in the Directory Table. See the Core Tables Group.
Read more >
Minor update with Basic MSI: New files are not copied to target?
Hi! I have quite a lot of experience with InstallScript setups but my company has decided to use Basic MSI install setups for...
Read more >
Missing Installer Project? Stay Calm & Carry On! - Revenera
When creating new windows installer projects, you want to keep project documentation, source files and completed packages in an organized ...
Read more >
WiX: Reference files in source media folder of MSI
I want to be able to do something like <Directory Name="stuff" SourceName="[SourceDir]stuff"> but that does not seem to work. wix · windows- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found