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

add windows postinstall script #2571

Closed
sdetweil opened this issue May 24, 2021 · 3 comments
Closed

add windows postinstall script #2571

sdetweil opened this issue May 24, 2021 · 3 comments
Labels

Comments

@sdetweil
Copy link
Collaborator

sdetweil commented May 24, 2021

it would be nice to resolve the issues with native windows install

the post install script won't run, but I finally figured out a reliable way

scripts launch a shell (sh or cmd.exe) and a single postinstall file won't work

BUT NODE runs..
"postinstall":"node somejsfile.js"
and u can pass parms

so I wrote a little launcher

"anyscript":"node execscript.js linux.sh:windows.cmd"
so, on any script, this will launch node execscript.js and pass the string "linux.sh:windows.cmd"

and then execscript will launch the linux.sh script on not windows platforms and the windows script (if supplied) on windows

i shortened the execscript.js name to es.js fewer chars...

SO, we could fix start too
"start": "node es.js 'DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js:node_modules/.bin/electron js/electron.js'"

or pass a script (runstart.sh or runstart.cmd)

ps.. you say you don't support windows, but all the text to work around the install problem is in the manual install text online..
https://docs.magicmirror.builders/getting-started/installation.html#manual-installation

@MichMich
Copy link
Collaborator

Sorry, I don't fully understand the issue or what's needs to be solved. Isn't the post install issues solved by a newer version of NPM?

@sdetweil
Copy link
Collaborator Author

sdetweil commented Sep 1, 2021

sorry, didn't see this response

so far not

you cannot run a sh file on windows
you cannot do any logic in the package.json script clause that isn't linux based
u cannot run a windows program on windows (doesn't work)
u cannot use the windows path with backslash in the text for the script action

but you CAN run node, and some js file

SO, if the js file can determine platform and it can, then it could launch a platform specific script/process
(which could be passed as parameters to the node js file)

@stale
Copy link

stale bot commented Apr 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 18, 2022
@stale stale bot closed this as completed Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants