KosalaHerath / macos-installer-builder

Generate macOS installers for your applications and products from one command
Apache License 2.0
323 stars 94 forks source link

Confised over Medium Blog #17

Closed toomanylogins closed 3 years ago

toomanylogins commented 3 years ago

Would be grateful if someone could explain this line of the medium blog.

bash /macOS-x64/build-macos-x64.sh [APPLICATION_NAME] [APPLICATION_VERSION]

Whats ? I guess its a path but to where same as ?

Thanks

KosalaHerath commented 3 years ago

It is the path to the repository home.

toomanylogins commented 3 years ago

Thanks for reply but I must be misunderstandind something.

  1. I have downloaded zip and copied to Users\Paul\Documents\macos-installer-builder-master\macOS-x64\
  2. Copied my application files to Users\Paul\Documents\macos-installer-builder-master\macOS-x64\application
  3. Run bash Users\Paul\Documents\macos-installer-builder-master\macOS-x64\build-macos-x64.sh YouDoCMS 1.0.0

I get error re apache maven missing, Ballerina missing and various target\darwin\scripts etc no such file or directory.

Would appreciate any advice. Thanks Paul

KosalaHerath commented 3 years ago

Hi Paul,

The warnings you got from Maven and Ballerina are pre-requisites that are specialized only for my example application. These requirements are not probably needed for your application and you can just comment the following code block.

#Pre-requisites
command -v mvn -v >/dev/null 2>&1 || {    
log_warn "Apache Maven was not found. Please install Maven first."    
# exit 1
}
command -v ballerina >/dev/null 2>&1 || {    
log_warn "Ballerina was not found. Please install ballerina first."    
# exit 1
}

This can be found in the following line. https://github.com/KosalaHerath/macos-installer-builder/blob/master/macOS-x64/build-macos-x64.sh#L182

However, these warnings will not affect your application and since these are just reminders (which can be ignored in your case), the installer should be generated without any other errors as follows.

Screen Shot 2021-06-01 at 12 33 43 am

Next, I have no idea about your "target\darwin\scripts etc no such file or director" error and if you can provide the log of errors as above you got, I will be able to provide more help on this case.

In addition, to clarify the process, just download and unzip the repository, and then without adding any application files just try to run the 'build-macos-x64.sh' script and check the installer generation works without any errors.

Cheers!

toomanylogins commented 3 years ago

Thank you for taking time to reply, I downloaded the zip again. Here is output after unzip to my documents folder on Mac 10.15.

bash /Users/paul/Documents/macos-installer-builder-master/macOS-x64/build-macos-x64.sh YouDoCMS 1.0.0 cat: ./utils/ascii_art.txt: No such file or directory

Application Name : YouDoCMS Application Version : 1.0.0 [2021-06-01 11:26:52][WARN] Apache Maven was not found. Please install Maven first. [2021-06-01 11:26:52][WARN] Ballerina was not found. Please install ballerina first. [2021-06-01 11:26:52][INFO] Installer generating process started. [2021-06-01 11:26:52][INFO] Cleaning target directory. cp: darwin: No such file or directory chmod: target/darwin/scripts: No such file or directory chmod: target/darwin/Resources: No such file or directory chmod: target/darwin/Distribution: No such file or directory sed: target/darwin/scripts/postinstall: No such file or directory sed: target/darwin/scripts/postinstall: No such file or directory chmod: target/darwin/scripts/postinstall: No such file or directory sed: target/darwin/Distribution: No such file or directory sed: target/darwin/Distribution: No such file or directory chmod: target/darwin/Distribution: No such file or directory sed: target/darwin/Resources/.html: No such file or directory sed: target/darwin/Resources/.html: No such file or directory chmod: target/darwin/Resources/: No such file or directory cp: ./application/.: No such file or directory cp: darwin/Resources/uninstall.sh: No such file or directory sed: target/darwinpkg/Library/YouDoCMS/1.0.0/uninstall.sh: No such file or directory sed: target/darwinpkg/Library/YouDoCMS/1.0.0/uninstall.sh: No such file or directory [2021-06-01 11:26:52][INFO] Application installer generation process started.(3 Steps) [2021-06-01 11:26:52][INFO] Apllication installer package building started.(1/3) [2021-06-01 11:26:52][INFO] Application installer product building started.(2/3) Do you wish to sign the installer (You should have Apple Developer Certificate) [y/N]?

toomanylogins commented 3 years ago

Thank you for taking time to reply, I downloaded the zip again. Here is output after unzip to my documents folder on Mac 10.15.

bash /Users/paul/Documents/macos-installer-builder-master/macOS-x64/build-macos-x64.sh YouDoCMS 1.0.0 cat: ./utils/ascii_art.txt: No such file or directory

Application Name : YouDoCMS Application Version : 1.0.0 [2021-06-01 11:26:52][WARN] Apache Maven was not found. Please install Maven first. [2021-06-01 11:26:52][WARN] Ballerina was not found. Please install ballerina first. [2021-06-01 11:26:52][INFO] Installer generating process started. [2021-06-01 11:26:52][INFO] Cleaning target directory. cp: darwin: No such file or directory chmod: target/darwin/scripts: No such file or directory chmod: target/darwin/Resources: No such file or directory chmod: target/darwin/Distribution: No such file or directory sed: target/darwin/scripts/postinstall: No such file or directory sed: target/darwin/scripts/postinstall: No such file or directory chmod: target/darwin/scripts/postinstall: No such file or directory sed: target/darwin/Distribution: No such file or directory sed: target/darwin/Distribution: No such file or directory chmod: target/darwin/Distribution: No such file or directory sed: target/darwin/Resources/.html: No such file or directory sed: target/darwin/Resources/.html: No such file or directory chmod: target/darwin/Resources/: No such file or directory cp: ./application/.: No such file or directory cp: darwin/Resources/uninstall.sh: No such file or directory sed: target/darwinpkg/Library/YouDoCMS/1.0.0/uninstall.sh: No such file or directory sed: target/darwinpkg/Library/YouDoCMS/1.0.0/uninstall.sh: No such file or directory [2021-06-01 11:26:52][INFO] Application installer generation process started.(3 Steps) [2021-06-01 11:26:52][INFO] Apllication installer package building started.(1/3) [2021-06-01 11:26:52][INFO] Application installer product building started.(2/3) Do you wish to sign the installer (You should have Apple Developer Certificate) [y/N]?

toomanylogins commented 3 years ago

Fixed. You have to cd to the folder containing the .sh script before running bash build-macos-x64.sh

KosalaHerath commented 3 years ago

Hi Paul,

Thank you for mentioning the issue. The issue with the absolute path is fixed with this commit now. Thus now you can run it from anywhere using the absolute path.

Cheers!

toomanylogins commented 3 years ago

Thanks.