How to create a exe file from an elixir project - windows

I am new to elixir and I am trying to create a command line app for Windows. I would like to deploy the app as an exe file that can be run from command prompt. I would also like the end user to not be required to install erlang to run the app if possible.
I have looked everywhere on Google and found nothing that seemed to help. I have installed Rebar3 but I don't know if that is what I need or not.
EDIT: I am currently using escript to run the app but I still have to type "escript app_name [args]" and I want to just run it as "app_name [args]".

You can create a release with exrm. Include it in your app dependencies in your mix file and then you'll be able to do something like : MIX_ENV=prod mix do compile, release
It will generate a tarball that contains everything you need to run your app. Including a bat file to start it on windows. It might not be a exe as you requested in your question, but it's still easy to from windows CLI
you'll find more information in the Phoenix doc (most of it applies to elixir apps without phoenix): http://www.phoenixframework.org/docs/advanced-deployment

Related

How do I edit Laravel app source code when developing in Docker?

I am trying to develop Laravel app using WSL 2 and Docker. I have followed official Laravel instructions for Windows development (https://laravel.com/docs/9.x/installation#getting-started-on-windows).
in WSL console I run:
curl -s https://laravel.build/example-app | bash
cd example-app
./vendor/bin/sail up
Everything seems to be fine (example-app is running on http://localhost), except I don't know how to do the actual development, i.e. edit the sources to see changes in the app.
I believe I have to somehow 'mount' directory sources from inside WSL/Docker into my Windows file system, but I don't know how.
I don't want to use VSCode (Laravel docs suggest that), I want to use IDE of my choice and access project files in general.
In the end I found out that this problem boils down to accessing WSL file system - Docker/Laravel files are synced automatically from there.
WSL file-system can be accessed through a path that looks something like this:
\\wsl$\Ubuntu\home\your-username\example-app
For some reason this was not visible in the Network section of Windows Explorer. You must type it manually or use the following trick:
Open WSL Linux console and go to the folder with your Laravel app. Then type the following:
explorer.exe .
(notice the dot)
This will open Windows Explorer at your current location and you will be able to copy the path and paste into your IDE.

How to automatically run cocoa application after install via installer

I have a built a cocoa application that I have packaged using package maker so that the app is installed using the installer.
After install is finished I want to run the installed application. In the package maker I can see postinstall actions, but I don't find an appropriate action to execute the application.
Any ideas what should I do ? my app is install in the /Applications/my.app
Should I write a script file of some sort or should the package maker help me run the app?
Thanks,
Ahmed
You need to add a postflight (assuming you want this for both installs and upgrades. If you just want it for installs, use postinstall).
Just call open "$3/Applications/my.app" to launch.
$3 is the install target. It's usually going to be /, but if you're being installed onto another volume, it could be something different like /Volumes/Other_Drive.

Mac OS install application and run a script on startup

I'm looking for a way to package my application with the added requirement that I need to add a python script to always run on startup.
What I've been trying so far is having a .pkg that installs the .app into the applications folder and adds the python script (wrapped in a .plist launch daemon) to the user's LaunchAgents folder.
I've tried a lot of different things, but for whatever reason the python script runs fine on the command line and just doesn't work when running through launchctrl. I could go into what the problems were, but I feel that would make more sense as a separate question.
I am wondering if I should be using a different approach to achieve my goal of installing the app in Applications and having a python script run on boot. Is there a more standard solution that I am missing perhaps? Thanks.

Grunt, Cordova & Windows Phone

I am developing an app for multiple platforms using Cordova. Grunt is used as a build tool. I use it to copy my source code to the right folder for each platform so I can develop them independently.
This works fine with Android using the scripts that are provided by Cordova. However, I have no idea if or how it is possible to automate the WP build process. I'm looking for two things:
Add all files in the www directory to the VS project (it does not include files that are not added to the project, which is sad).
Build, install and run the app in the emulator. I used adb & Grunt's exec for Android which was really simple, is there something similar for WP?
If you look in a cordova windows phone project there is a directory called 'cordova' which contains scripts to do all of this.
There should be scripts to build and run your project.
The run script can pretty much do it all. You can call it like :
run --device --release
or
run --emulator --debug
or just
run
A recent commit now makes it possible to use www\** in the .csproj file, which solved my first issue.

GAE Go Windows - "Cannot run program", "is not a valid Win32 application"

I've been trying to run a GAE Go project I developed on my Mac on my Windows machine with GoClipse after installing and configuring the appropriate SDKs and so forth. When attempting to run the project, I get this error:
Exception occurred executing command line. Cannot run program
"C:\GoogleAppEngine\dev_appserver.py" (in directory
"D:\Golang\workspace\Project\src\pkg"): CreateProcess
error=193, %1 is not a valid Win32 application
How can I fix that error in order to run my project?
While the below configuration works on the Mac as it has Python installed by default, Windows requires a different configuration.
On Mac the GoClipse External Tools Configuration would be:
Location: /GoogleAppEngine/dev_appserver.py
Working Directory: ${workspace_loc:/Project/src/pkg}
Arguments: .
The Windows configuration should look like:
Location: C:\Python27\Python.exe
Working Directory:
Arguments: C:\GoogleAppEngine\dev_appserver.py "${workspace_loc:/Project/src/pkg}"
Trying to run .py (Which IMO is a Python file?) wont work directly on windows. You will need to install Python and then pass the above filename to Python something like (I don't know Python so don't go by exact syntax, you might need to look around)
python "C:\GoogleAppEngine\dev_appserver.py
The reason it's working on Mac is because Python comes pre-installed on mac as cited here But on windows it doesn't. So you can install Python and add the Python's bin folder to path, and then run above script and it should run fine!

Resources