OSX, restore installs made with terminal - macos

During a long period of time I have installed some apps/scripts with the terminal, many were tests to understand some tools, and now I use just a few of them (very few).
What I would like to accomplish is to wipe them all in order to "restore" OSX installs and, later on I will reinstall the one I need.
I'm not sure I'm using the right terminology, I installed things via terminal like:
nodej
meteor
ionic
And other stuff, some with the use of curl ..., others with OSX Installer (NodeJS for example) and others with cordova I guess.
How to remove them all?

Related

Using Mac Terminal To Run .EXE

One of my friends sent me a link on how to use terminal to get OSU! to run on mac. It worked perfectly, but now I am wondering if it is only for certain things, or if I can use terminal commands to make a .exe program run?
Anyone know if this is possible, and if so how would I go about doing it?
Thanks.
Macs aren’t compatible with Windows apps.
But you can try an app called wine.
Wine tries to provide an environment to run Windows exes.
Download the binary packages at here
Get the stable installer.
Make sure that you’ve got xquartz installed using homebrew: brew install xquartz.
The easiest and free way to run .exe files is to run it on "PlayOnMac". It might show some bugs(never faced a major bug). but it solves the problem. You can easily copy paste files on it like if you want to crack the software.

Installing .pkg: determining if the app being updated is presently running?

I'm using the brilliant Mac OS X "Packages" to generate an install a .pkg, and wondered how one constructs a shell script to make sure the application file being updated over isn't presently running (which would seem like a Very Bad Idea).
Normally this would be handled by using a pre-install script, or installer plug-in. It's unclear what you plan on doing though if the application is running.

How to create application to launch wine and Windows application

I'm trying to use "wine" on MAC osX Sierra version 10.12, wine is version 1.9.19
In the terminal I can launch Windows applications, however its a pain to have to keep typing in:
/Applications/Wine\ Staging.app/Contents/MacOS/wine ~/.wine/drive_c/Program\ Files/HeidiSQL/heidisql.exe
I've searched around for a post on how to create shortcuts/applications to add to the launchpad, but so far none of the information has led me to a working end result. Either the locations of wine is different or it just doesn't work.
I've tried creating an application script:
do shell script "/Applications/Wine Staging.app/Contents/MacOS/wine ~/.wine/drive_c/Program Files/HeidiSQL/heidisql.exe"
But this won't run either.
For anyone having the same problem, in the end I created scripts which reside in my home folder:
Launch vi, create a file called HeidiSQL, insert:
wine ~/.wine/drive_c/Program\ Files/HeidiSQL/heidisql.exe
Save and exit file, grant file execute permissions:
chmod +x HeidiSQL
Launch wine terminal and type in ./HeidiSQL to launch, I then did the same for PSPad.exe:
wine ~/.wine/drive_c/Program\ Files\ \(x86\)/PSPad\ editor/PSPad.exe
I know this thread is a little old but I was just looking for something like this to launch HeidiSQL and I came up with these three solutions which I have tried and all of them work. I am putting my findings down here for it may help someone:
Wineskin (http://wineskin.urgesoftware.com), Playonmac (https://www.playonmac.com/en) and Winebottler
(http://winebottler.kronenberg.org)
Wineskin is a mac app that download and install (and manages, updates, etc) "wine" for you. It then creates a HeidiSQL.app (any name you want with any icon you want - but you need to configure it) around the windows.exe that includes the wine version selected and is completely self contained (does not need wine installed separately). Personally this is the neatest solution and my preferred even though there its a little more technical than Playonmac and similar to Winebottler. You need to read the instructions (which are very good) and you have choices to make as to the wine version to use and to configure the app. Noteworthy is that you need to change the windows version to XP rather than 7 or some buttons won't work.
Playonmac on the other hand is very user friendly. It has HeidiSQL listed on its website as compatible and its almost a single click install. You just select HeidiSQL from the list of programs and it will download everything you need for you. The only reason I prefer Wineskin is that it does not create a true self contained HeidiSQL.app. You can create a shortcut for it in your Applications folder but this will launch Playonmac and the app needs to be installed inside Playonmac. On the plus side, Playonmac will chose all the right settings for you to run the app correctly, the correct windows and wine version etc which is something you need to fiddle with with with Wineskin.
Winebottler again makes an app like Wineskin. The only real difference I could see is that with Wineskin the configuration app is actually part of the package whereas in Winebottler you have to recreate the package each time you make a change. I stuck with Wineskin. YMMV.

Benefits of Homebrew Cask over tradicional installation method?

I know how does Cask works and all the benefits I can get when using it in a brand new system, but what I want to know and I don't seem to find and answer anywhere is... would it be a good idea if I delete my previous installed software and replace them with cask versions? would I see some kind of improvement, or would it be a waste of time?
There's no real advantage to reinstalling existing binaries using homebrew-cask. It's strictly a workflow improvement for when you need to install various softwares. For instance, if you wanted to have a script to install all your regularly used binaries on a new computer, that would be more efficient than manually visiting several sites and downloading, installing, etc.
Traditional software installation on some apps have automatic updates and some require the user to visit the apps website to do an update. Once the update is downloaded the user is required to click next, next, agree etc whilst it is satisfactory to do this for a few apps it can be time consuming.
One of the advantages of HBC is that it does an install without user interaction or sometimes a prompt for admin password. So if you do a reinstall of the OS you can use HBC to reinstall the additional apps.
At present there is no provision for updates using HBC so i have written scripts that take of some issues.
The scripts will create a file that lists the files to be updated including apps that are defined as latest. You can then modify the file to suit your requirements and install updates using my olinst script.
For more information visit my github.
https://github.com/pacav69/homebrew-homebrew-caskroom-offline-installer

Uninstaller for package on Mac OS X

As a service to my users I would like to provide an uninstall script to completely remove all traces of my application on Mac OS X. The application is installed using a package rather than just being dragged into the Applications folder because it is a daemon-type app that also requires to run a script at installation to be launched.
My thinking is to include a file called uninstall.sh and place it into /Library/Application Support/com.<mycompany>.<myapplication>/ and refer to this from the application documentation. The purpose is basically to stop the daemon if running, unload and delete the corresponding plist as well as remove any application files. Does this sound reasonable or are there better methods to accomplish this?
Also I am wondering if it is good practice to also remove traces of the package using pkgutil --forget - if I don't do this, the next time the package is installed it shows up as being upgraded instead of installed. Any recommendations or pointers to best-practice information?
Is there no standard way of doing this on OS X?
There is no standard way of doing this on OS X. Yes, shocking, I know. Apple consistently warns everyone away from package installers (among other things by providing insufficient documentation for them). They then exclusively use package installers for their own standalone apps.... go figure.
Yes, you should include pkgutil --forget.
If your customers are comfortable with this kind of script, then your approach sounds fine. If they want a "double-click-on-it" then you should probably put the uninstaller in /Applications, but avoid that if you can.
If you have a GUI, Status Item, or Preference Panel, then it's nice to put a "Uninstall" button or menu item there rather than requiring them to go mess around with Terminal.
BTW, if you go looking for the Software Delivery Guide, it's been moved for a year or so now, while they "update" it.
the inability to remove packages has bugged me for years, so i've written a tool to uninstall packages:
http://www.corecode.at/uninstallpkg/index.html
its a bit better than the shell scripts to do it floating around because it makes sure never to remove any files that are used by any other installed packages
The way I solved this was to use Automator, create an application document and then add dialog and script actions. Finally save your Automator application document and you end up with a simple GUI application to run the uninstall.
Often the uninstall action requires administrator privileges - I solved this in Automator by running a shell script action that generates another shell script that can then by run in an applescript action as follows:
on run {input, parameters}
do shell script "/tmp/uninstaller.sh" with administrator privileges
return input
end run
I have a similar application and came across the same issue. The approach I took was one that I have seen other applications use. Rather than simply distributing the .pkg installer, wrap it up in a .dmg file. The uninstall script can be included with the .pkg in the .dmg.
The uninstall script is then renamed to "uninstall.tool". The .tool extension allows users to run the script by double clicking, rather than having to run it from the command line.
Slightly unconventional, but aren't these all. I have Homebrew and cask installed. I was able to uninstall a .pkg with the following:
brew cask uninstall --force <pkg_name>
ex. brew cask uninstall --force dockertools

Resources