-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
asarUnpack unpacks parent directory when file is specified #1071
Comments
Just tried it on macOS (building for darwin x64), same result. |
Cannot reproduce (see my commit to test it). Please set env |
The logs look fine to me: > @ dist C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer
> build "--win" "--ia32"
No native production dependencies
Packaging for win32 ia32 using electron 1.4.13 to dist\win-ia32-unpacked
electron-builder Spawning C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\node_modules\7zip-bin-win\x64\7za.exe x -bd C:\Users\Ahmad Ouerfelli\.electron\electron-v1.4.13-w
in32-ia32.zip -oC:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\dist\win-ia32-unpacked +0ms
7-Zip (a) [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04
Scanning the drive for archives:
1 file, 44030471 bytes (42 MiB)
Extracting archive: C:\Users\Ahmad Ouerfelli\.electron\electron-v1.4.13-win32-ia32.zip
--
Path = C:\Users\Ahmad Ouerfelli\.electron\electron-v1.4.13-win32-ia32.zip
Type = zip
Physical Size = 44030471
Everything is Ok
Files: 74
Size: 108417432
Compressed: 44030471
electron-builder C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\node_modules\7zip-bin-win\x64\7za.exe (10572) exited with code 0 +3s
electron-builder Dev or extraneous dependencies: +0ms
electron-builder Found existing winCodeSign C:\Users\Ahmad Ouerfelli\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.5.0 +788ms
electron-builder Executing C:\Users\Ahmad Ouerfelli\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.5.0\rcedit.exe C:\Users\Ahmad Ouerfelli\Documents\Personal\station
-timer\dist\win-ia32-unpacked\Station Timer.exe --set-version-string CompanyName Ahmad Ouerfelli --set-version-string FileDescription Station Timer --set-version-string ProductName St
ation Timer --set-version-string InternalName Station Timer --set-version-string LegalCopyright Copyright © 2017 Ahmad Ouerfelli --set-version-string OriginalFilename --set-file-vers
ion 1.0.0 --set-product-version 1.0.0 --set-icon C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\build\icon.ico +0ms
Building zip
electron-builder Spawning C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\node_modules\7zip-bin-win\x64\7za.exe a -bd -mm=Deflate C:\Users\Ahmad Ouerfelli\Documents\Person
al\station-timer\dist\Station Timer-1.0.0-ia32-win.zip win-ia32-unpacked +763ms
7-Zip (a) [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04
Scanning the drive:
7 folders, 77 files, 108369660 bytes (104 MiB)
Creating archive: C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\dist\Station Timer-1.0.0-ia32-win.zip
Items to compress: 84
Files read from disk: 77
Archive size: 42774627 bytes (41 MiB)
Everything is Ok
electron-builder C:\Users\Ahmad Ouerfelli\Documents\Personal\station-timer\node_modules\7zip-bin-win\x64\7za.exe (9032) exited with code 0 +8s Here is my development package.json: {
"scripts": {
"start": "electron ./app",
"dev": "nodemon --exec \"npm start\" -e \"js css html\"",
"pack": "build --dir",
"dist": "build",
"postinstall": "install-app-deps"
},
"directories": {
"app": "./app"
},
"build": {
"appId": "com.aouerfelli.station-timer",
"asarUnpack": [
"res/strings.json"
],
"win": {
"target": [
"zip"
]
},
"mac": {
"category": "public.app-category.utilities",
"target": [
"dmg"
]
},
"linux": {
"category": "Utility"
}
},
"devDependencies": {
"electron": "^1.4.13",
"electron-builder": "^10.15.1",
"nodemon": "^1.11.0"
}
} |
Is it possible to provide your project? (or I will try to investigate using some real my project). |
Just pushed the initial code drop, you can view the project in this repo. |
I am seeing this error as well! Since the file is in the root dir of app, it's unpacking everything for me. In @aouerfelli 's example, I am trying to unpack the |
Bug identified. @aouerfelli But in your case it seems that |
I thought about that too, but I'd rather not have those be replaceable and only allow the strings to be modified. If someone really wants to change the font or sound, they can clone the repo, edit it, the build it for themselves. |
@aouerfelli So, you can use fonts inside asar archive and it works? |
@develar Seems like it. I'll test it again just in case (because I already have that font installed on my local machine), but if the audio works, then I don't see why the font wouldn't work as well. |
@develar thanks so much! this fixed my problem!! woo! |
When a relative path from the app directory is passed into the
build.asarUnpack
option, the parent directory is copied instead of the file itself.Example:
In
package.json
:In the shell:
Output Directory:
dist\win-ia32-unpacked\resources\app.asar.unpacked\res\
<all files and sub-directories in originalapp/res
, includingfile.json
>Other Notes:
I'm using the two package.json method (even without any external dependencies) if that matters.
I will try building this on macOS shortly and reporting back with my results.
The text was updated successfully, but these errors were encountered: