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

limitation to windows?! #6

Closed
red171 opened this issue Sep 4, 2020 · 5 comments · Fixed by #8
Closed

limitation to windows?! #6

red171 opened this issue Sep 4, 2020 · 5 comments · Fixed by #8

Comments

@red171
Copy link

red171 commented Sep 4, 2020

Can you please explain, what do you mean with

Due to the requirement of NSIS, this is only compatible on Windows.

for example, i build all my nsis based setups on macOS with makensis
also nsis is available in Ubuntu

currently, i moved everything to github actions and this action was the only one which provide makensis.
But, i don't understand the limitation to windows?!

@joncloud
Copy link
Owner

joncloud commented Sep 6, 2020

Thanks for bringing this to my attention.

I made an assumption when writing up the documentation for this project, that because NSIS was for Windows installers that it was only available on Windows platforms.

After reviewing the implementation, I think I could make some minor adjustments to allow for alternative platforms. My initial thought would be to alter the inputs to the action so that I would defer to your project to install / path to makensis. For macOS you could use homebrew, and Ubuntu you could use apt.

TLDR - I can add an input that will allow you to provide a path to a preinstalled makensis.

@idleberg
Copy link
Contributor

idleberg commented Sep 7, 2020

If you don't mind the extra dependency, you can use makensis' nsisDir/nsisDirSync methods to retrieve the value of ${NSISDIR}. Some background: on non-Windows systems, the makensis binary (e.g. usr/local/bin/makensis) will reside in a different directory than the Plugins folder (e.g. /usr/local/share/nsis).

@joncloud joncloud linked a pull request Sep 8, 2020 that will close this issue
@joncloud
Copy link
Owner

joncloud commented Sep 8, 2020

I have created #8 in order to better support Linux and macOS using this action.

@red171 , @idleberg - I did some basic testing with Ubuntu and macOS, and based on my results I have the following possible paths. I can make adjustments to either add entries, or make the entries an action input if necessary. Let me know if you see any problems.

return {
  makensis: firstValidPath([
    '/usr/local/bin/makensis',
    '/usr/bin/makensis'
  ]),
  plugins: firstValidPath([
    '/usr/local/share/nsis'
  ])
};

@idleberg
Copy link
Contributor

idleberg commented Sep 8, 2020

When you install NSIS with MacPorts, the default location will be as follows:

  • /opt/local/bin/makensis
  • /opt/local/share/nsis

On Ubuntu, Fedora and macOS the makensis binary is usually in the PATH environment variable, so the detection might be quicker assuming makensis as first element of the array. As far as I know, the location of NSISDIR can be set at build time. The most reliable way to get that location is probably parsing the output of makensis -HDRINFO (which is exactly what my makensis module for Node.js does)

Example:

$ makensis -HDRINFO

Size of first header is 28 bytes.
Size of main header is 300 bytes.
Size of each section is 4120 bytes.
Size of each page is 64 bytes.
Size of each instruction is 28 bytes.

Defined symbols: __GLOBAL__,NSIS_CHAR_SIZE=1,NSIS_COMPRESS_BZIP2_LEVEL=9,NSIS_CONFIG_COMPONENTPAGE,NSIS_CONFIG_COMPRESSION_SUPPORT,NSIS_CONFIG_CONST_DATA_PATH,NSIS_CONFIG_CRC_SUPPORT,NSIS_CONFIG_ENHANCEDUI_SUPPORT,NSIS_CONFIG_LICENSEPAGE,NSIS_CONFIG_PLUGIN_SUPPORT,NSIS_CONFIG_SILENT_SUPPORT,NSIS_CONFIG_UNINSTALL_SUPPORT,NSIS_CONFIG_VISIBLE_SUPPORT,NSIS_CPU=x86,NSIS_DEFAULT_LANG=1033,NSIS_FIX_COMMENT_HANDLING,NSIS_IX86=300,NSIS_LOCKWINDOW_SUPPORT,NSIS_MAKENSIS64,NSIS_MAX_INST_TYPES=32,NSIS_MAX_STRLEN=1024,NSIS_PACKEDVERSION=0x03005666,NSIS_PTR_SIZE=4,NSIS_SUPPORT_ACTIVEXREG,NSIS_SUPPORT_BGBG,NSIS_SUPPORT_CODECALLBACKS,NSIS_SUPPORT_COPYFILES,NSIS_SUPPORT_CREATESHORTCUT,NSIS_SUPPORT_DELETE,NSIS_SUPPORT_ENVIRONMENT,NSIS_SUPPORT_EXECUTE,NSIS_SUPPORT_FILE,NSIS_SUPPORT_FILEFUNCTIONS,NSIS_SUPPORT_FINDFIRST,NSIS_SUPPORT_FNUTIL,NSIS_SUPPORT_GETDLLVERSION,NSIS_SUPPORT_GETFILETIME,NSIS_SUPPORT_HWNDS,NSIS_SUPPORT_INIFILES,NSIS_SUPPORT_INTOPTS,NSIS_SUPPORT_LANG_IN_STRINGS,NSIS_SUPPORT_MESSAGEBOX,NSIS_SUPPORT_MOVEONREBOOT,NSIS_SUPPORT_NAMED_USERVARS,NSIS_SUPPORT_REBOOT,NSIS_SUPPORT_REGISTRYFUNCTIONS,NSIS_SUPPORT_RENAME,NSIS_SUPPORT_RMDIR,NSIS_SUPPORT_SHELLEXECUTE,NSIS_SUPPORT_STACK,NSIS_SUPPORT_STANDARD_PREDEFINES,NSIS_SUPPORT_STROPTS,NSIS_SUPPORT_VERSION_INFO,NSIS_UNICODE_MAKENSIS,NSIS_VARS_SECTION=.ndata,NSIS_VERSION=v3.06.1,NSISDIR=/opt/local/share/nsis,PREFIX_CONF=/opt/local/etc,PREFIX_DATA=/opt/local/share/nsis,PREFIX_DOC=/opt/local/share/doc/nsis

@joncloud
Copy link
Owner

Thanks for all of the feedback on this. I have released v3.2, which should now work with multiple platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants