You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
I’m using windows-shortcuts in my project to create a few windows desktop shortcuts. It works fine running on Node, but after pkg it won’t because I think it cannot resolve the external path or the variable %UserProfle%.
I’ve tried using path.resolve and join, with process.cwd() as base argument.
Any suggestions how could I achieve that?
The text was updated successfully, but these errors were encountered:
trepichio
changed the title
How to reach %UserProfile% with pkg?
Is it possible to use windows-shortcuts with pkg??
Dec 22, 2019
I'm not sure what's present in your process.env, you may need to manually set the corresponding environment variables manually if they're not being passed by pkg
Thanks for the reply!
I kind of fixed this issue by using require('os').homedir() and copying the Shortcut.exe to outside of snapshot, into process.cwd().
Then, I replaced in windows-shortcuts.js those lines where contains __dirname by process.cwd()
It works fine now!
However, I'm facing another issue.
I want to delete this external Shortcut.exe after creating several shortcuts, but I am not being able to.
I've tried using fs.unlinkSync and shelljs.rm and both works great for other files but not this one. I think it's because of some delay to execute the callbacks of each ws.create but they don't return a Promise or anything at all to be able to track.
I've tried to add each ws.create call to an array and pass them to Promise.all but it's not working too.
How can I track when all ws.create are totally done and then being able to delete the .exe?
I’m using windows-shortcuts in my project to create a few windows desktop shortcuts. It works fine running on Node, but after pkg it won’t because I think it cannot resolve the external path or the variable %UserProfle%.
I’ve tried using path.resolve and join, with process.cwd() as base argument.
Any suggestions how could I achieve that?
The text was updated successfully, but these errors were encountered: