Generated Windows Installer (MSI) does not preserve source App Directory Structure
See original GitHub issueHi 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:
- Created 6 years ago
- Comments:6
Top GitHub Comments
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
Just as tip to future visitors: you can also use (assuming run from app’s root directory):
This way you can avoid hard-coded paths in case you need to distribute the build script source.