How do I make an executable that will add my Automator service which runs a bash script? - macos

My friends are losing points in their computer science classes because their submission graders decompress and read zip files, which are obfuscated by a bunch of Apple metadata crap generated from zipping a file through the right-click contextual menu in Finder.
I've written a bash script to zip only unhidden files from a specific directory, and I've added a contextual menu service through Automator so this script can be run from right clicking a file.
The problem is I don't want to manually copy over all this stuff and make Automations on each computer my friends use. I'd like to leverage make or some similar utility to make an executable that will add the bash file and automator menu service to any computer the executable is opened from.
I'm lightly familiar with make (more familiar with rake), but I can't find out how to package the automator service and install it on their machine through an executable.

You'll want to package your automator application and script(s) into an Installer Package (.pkg). The best way to achieve this is to understand some general concepts, the commands to build one, and by checking out some tutorials or other relevant information.
I recommend for creating your first Installer Package using a utility
such as Packages (open-source and free), which has excellent
documentation, and is less complicated than using the command
line tools. Basically it puts a nice gui around the Apple tools which
are somewhat nonintutive by themselves.
Building Installer Packages is not the easiest thing to do your first time, and it might take a bit of patience to finally get it right. Once you've successfully created one you should have a good grasp on what is involved in putting them together along with the concept behind it all. At the very least, this information hopefully points you in the right direction regarding your question, and/or gives you a better idea of how to accomplish what you want to do.

Related

Looking for the simplest way to wrap a provided Setup.exe installer with a config.dat and a silent installation CLI execution

I am not familiar with Windows installer builder tools, other than having a conceptual understanding of them. I have a hopefully simple installer-file-wrapping-problem to solve where i would need some advice from people who know this field better than myself:
I have a vendor provided vanilla Setup.exe installer along with a custom config.dat file.
I can run the installer with "Setup.exe /S" which picks up the config.dat file in the same directory for a silent install just as I need it.
I now want to wrap both files into a single file self executable installer "CustomSetup.exe" that if launched with "Run as Administrator" silently unpacks the two files into the same directory, runs the silent install command line "Setup.exe /S" and deletes the previously unpacked files and directory afterwards. Effectively giving me a single-file one-click silent installer with custom settings from the vendor provided vanilla installer.
What is the simplest, most straight forward and elegant way of getting this done?
Most InstallShield/WIX/Windows Installer Tools tutorial- and documentation-pages i could find want to take me to an elaborate installer-project-building-academy first, something that is certainly useful for developers needing to learn how to build complex installer projects, but feels like overkill for just getting this seemingly simple thing done. Is there a lean way to do this? Many thanks in advance for your help.
For the record, I have found the answer to my own question.
Running the Windows on-board IExpress (as Administrator) easily produced exactly what I was after. Just type "Iexpress" into the command search box, run as Administraor and fidlle with it. Alternatively, this is someones Video explaining it https://www.youtube.com/watch?v=vXZyq0cMuKI

Connecting dots from self-contained Java application to Mac OS installation

I am not a Mac owner and am putting myself through a crash course to get up to speed (e.g., reading "Switching to the Mac"), to give you an indication of my current level of understanding. The access I have to a physical Mac is limited, so I am trying to connect as many dots as possible before my next session with my friend's computer.
I have: a file folder containing all resources needed for a self-contained application written with Java (OpenJDK 11, JavaFX 11). The JLINK tool was successfully used to create this file folder, and it holds all necessary Java libraries as well as the code I wrote for the application. The executable resides in a subfolder: /bin. The program runs perfectly well on the Mac when the executable is run.
I want: something that is easy to download, install and run.
I'm unclear about what needs to be done to get this. The road map seems to have two main steps:
the file folder needs to be converted into something that responds as if it were an application (e.g., a Bundle? or an .app?)
the resulting folder-as-executable can be shipped via either .dmg or .pkg
For the second part, I've researched and found tools such as Packages or create-dmg. It seems to me these tools are pretty straightforward and shouldn't be too difficult to learn to use. (Just have to pick one or the other or something similar.)
For the first part, I'm on shaky conceptual ground. I've found info about Bundles, but no tutorials, walk-throughs or examples. It looks like a key step is understanding how to make a proper Info.plist file, but doing this properly looks tricky. Also, I'm not clear on how the resulting Bundle will become an .app file or if it needs to, or if there is another, more direct way to make my file folder be viewed by the OS as an application.
Some hand-holding or references to tutorials or even assurance that I am on the right track (if that is the case) would be much appreciated. Thanks!
The Java Deployment guide from Oracle relies heavily on ANT, but doesn't cover the case of a self-contained, customized JVM via JLINK well enough for me to decipher. So, I've taken the approach of trying to learn/understand the necessary steps using command-line commands.
While creating a Bundle is certainly an option, there is an easier way.
Step one is to make an .app manually. An answer to this question: "How to make a Mac OS X .app with a shell script?" goes over the basic steps. The Java file system that results from jlinking has a folder /bin in which there is a bash file that runs the program. This file should be moved to the outermost folder, and it should be named the desired name of the application. The bash file itself will have to be edited and "/bin" added to the address in last command so that the executable will be found. In addition, the folder itself will have to be renamed to be the same as the bash file, but with .app added as an extension.
The next thing I wanted to have was a custom icon. The question "Include icon in manually created app bundle" shows how to do this.
For the next step I made use of the program "Packages". I'm a bit confused about where I downloaded this from (there seem to be multiple sites), but here is a link to the manual. This tool allowed me to create a .pkg file that, when executed, installs my .app in the Applications folder. Then I compressing the .pkg file (to .zip) and made it available at a URL for downloading.
I've had a friend do a test download and install, and the program works!
This isn't meant to be a complete tutorial, and there are a few steps more that I want to figure out pertaining to sandboxing and sealing, but I believe this is a reasonable roadmap that can be used for simpler jlinked Java applications for Mac distribution.

Installer for Executing Multiple Installs

I've been to stackoverflow.com many times, but this is my first time posting here. I'll try to be as specific and to the point.
I'm in the process of converting all my PC discs into digital .iso files and there's a few games I have that are multi-install discs.
Recently I've started using Inno Setup and so far I've had a lot of success consolidating multi-disc installs into a single program executable.
The one I'm currently focusing on is the Battlefield 1942 series. It requires initial installation, multiple expansion installs, plus a major patch, plus the installing of a mod that takes multiple steps.
My question to the community is how would I pack all of the above files into one executable and have them install everything in order? If it can be done through Inno, I'd like to try that. Or if you suggest another program I can always take time to try and learn it.
I've tried making a batch file for this a while ago but it ended up kind of clunky and I really didn't like the way it turned out.
Also, is there a way to insert check boxes into Inno to choose what executables run? (this part of the post isn't as important as the above request, just kind of a bonus if possible).
Really looking forward to the community's response on this!
One approach you can follow is to create a installer of installers, where you just pack the installers you have now and at installation time run each in the precise order you do now to get your fully installed and patched game.
That way, you don't have to learn each file/registry key or other settings each game have, and the risk of failure if you forget to include something vital to it.
What you have to do in order to do that properly, is to learn if the current installers accept it's own configuration from command line parameters or text files (many installers do it, for example the /silent or /verysilent command line parameters to run on the background). Once you do, use the [run] section of your script to launch each installer passing the parameters via command line or pre-made text files, or even you can create a text file or command line parameters on the fly using the [code] section with the built-in pascal script.
If your installers don't accept parameters, you can even reach your goal to keep all in one single exe file which you can run and then configure each individual installer as it launches.
Your question is overly broad to include here a working example, but you can find guidance by studying the scripts in the samples directory.
As for your final question
Also, is there a way to insert check boxes into Inno to choose what executables run?
You can use the [run] section to let the user select what to run at the end.
Or you can use the [tasks] section to create different sets of files/configurations.
A final word is to check the available flags for your install script entries, for example, deleteafterinstall to cleanup individual installer included among your [files] entries, or the [uninstallrun] section to give a unified uninstaller also.
In my opinion, if the final result should be fully patched version with mod installed, you should build new installer that will contain that fully patched game with mod.
You can do it easy way to find out what is changed/added by each patch, addon, MOD.
After installation of each thing (addon/mod/etc.) make a backup copy of the installation folder and check the registry entries.
Then just compare folders/directories and filter out specific files for each patch, addon, MOD.
At the end you will be able to add each addon and MOD as Components (files and registry entries) - that will create checkboxes in the Components Selection Wizard Page.
Easiest way:
For External Installers/3rd Party Apps at the end of installation more info to be found here: http://www.jrsoftware.org/ishelp/index.php?topic=runsection

Create an installer program: read a path to install to, from registry key (something like wix/installshield/nsis)

I would like to create an installer of my program.
However because the installation is quite complicated, I need something more advanced than installshield limited edition.
I have to run another installer from my current one. It doesn't matter if the user press "cancel" or installs the program, I just need to run it.
I have to install a directory structure on user computer which has a lot of files, that's why i'm going mad with wix: 100 files and I should write all of them with my hands in that xml file? Are we mad?
I have to install files from point 2 into a registry key. That's why I was using wix
I played with nsis long time ago and I liked it, but the language is not so nice.
Wix has "similar" problem. I would love using something like C# and things like that otherwise I'll stick with wix but I need a way to add files faster to xml file, can't add 100 files manually.
Any suggestion?
You can give Advanced Installer a try. It has folder synchronization, which means it can batch add contents of folders, with the possibility to filter out certain file name patterns, for example you'd want to filter *.pdb files and add all the rest to the project automatically.
I use it myself and never had a problem.
Wix Heat can generate the wxs source files for you.
You should look at InnoSetup. It has an IDE available that allows drag and drop of files (and multiple select in a file selection dialog), can launch other applications (including additional setup files), create and modify registry settings, and supports pretty complex scripting if needed. It's pretty easy to use, and the documentation is pretty good. It comes with pretty comprehensive sample installations, too.
The installation scripts are created by the IDE and then compiled into an installer, so the script source is editable by hand if needed. It's also not XML, but more like an INI file, so it's a little easier to work with manually as well.
Best of all it's free, and so is the IDE.
I would go back to using NSIS, if you use the HMNSIS editor http://hmne.sourceforge.net/ to write your scripts you can use the Wizard mode to make a list of the files and directory structure you will use in your installer.
Running other installers and registry settings are also easily done with NSIS.

Relocating ".fig" files when creating a GUI using Matlab GUIDE

I've developed a GUI for some build scripts, and am now in the process of deploying it. As the script will be deployed to a number of different machines at various points, I need to use the standard format of directories that the team use.
The GUI consists of a ".fig" file that contains the visual definition of the UI, and a m-script that defines the functionality. I need to locate these two in "fig/" and "m/" folders respectively, but I can't figure out how to. I first searched for an include statement of some kind in the m-script, as when I Run it on its own, the error message in the command window states that the ".fig" file can't be found, but there doesn't seem to be a reference to the ".fig" file anywhere, I assume that it's inferred as both files have the same name but a different extension.
I fear that Matlab's GUI system requires that both ".m" and ".fig" files are in the same location, but this will be an inelegant solution that I'd rather not go for if I can avoid it.
The next thing I'm going to try is to call a script that copies the fig file from the other directory to the same location as the m-script, when it is executed, then deletes that copy once the script exits, which again seems a clunky solution, but will allow me to adhere to the team's organisation conventions.
Does anyone else know of an undocumented means of specifying the relative location of a GUI ".fig" file?
You can export the GUIDE-generated GUI as a single .m file. Check out this blog post: GUIDE GUIs in All One File.
I'm not sure if this is a new feature, or one of those things that has always been there...

Resources