Disabling UAC Prompt for Cygwin run.exe in Windows 7

So, every time I try to start Cygwin (actually, the cygwin XWin server) I get that ugly UAC prompt. Very annoying since this is an application I use quite frequently. Unfortunately, changing the properties to always “Run As Administrator” does not fix it.

The only way I’ve successfully managed to get it to work is through the Application Compatibility Toolkit from the Microsoft Download center. Download and install the Application Compatibility Toolkit. Once installed, run ACT as administrator. Right click on its menu entry while holding the Shift key and select Run as Administrator. Note that you have to run the correct version for the architecture of the target program. For instance, Cygwin is 32-bit so the 32-bit version of ACT must be used.

Application Compatibility Toolkit

This will open up a new custom database that we will edit. From here click the Fix icon in the toolbar.

Application Compatibility Toolkit

In the Create new Application Fix dialog, give it a name, the vendor is optional, and select the path to the executable. The executable we want is run.exe on my machine at C:\cygwin\bin\run.exe.

Create new Application Fix

Click next, and next again. From the Compatibility Fixes list, select “RunAsInvoker” and click Finish.

Create new Application Fix

Next save the database by clicking the save icon. You will be prompted to provide a name.

Database Name

Once it is saved we have to install it. Right click on the database in the tree and select Install.

Application Compatibility Toolkit

Installed dialog

Now you should be able to click the Cygwin XWin Server icon and it will start without prompting you. One additional issue I had was that before any of this I had created a Quick Launch icon for the XWin Server. For some reason, these changes do not take affect right away for the Quick Launch icon only. I had to delete and recreate the Quick Launch icon before I could start it that way without being prompted.

Managing MinGW packages with mingw-get

This isn’t meant to be a comprehensive tutorial on everything you can do with mingw-get but rather a place for me to document some tips that I found Googling and felt I should consolidate here. If something here does not work for you or if you have some other useful pointers let me know and I’ll update this post.

MinGW is standard equipment on any new Windows computer I need to use which includes most of the tools I use regularly. I had a need to create zip files recently however zip and unzip are not included in the base MinGW installation. The easiest way to install these utilities is through mingw-get.

$ mingw-get install msys-zip
$ mingw-get install msys-unzip

This lead me to the question, what additional packages are actually available this way? Cygwin provides a nice GUI to pick and choose packages and of course there are the various package managers available for the many Linux distros. There doesn’t seem to be an easy way to list packages that can be installed with mingw-get. One method I found is to look in the catalog file.

$ grep "package name" /mingw/var/lib/mingw-get/data/*.xml

Or to make the output a little nicer:

$ grep "package name=" /mingw/var/lib/mingw-get/data/*.xml |
    sed 's/.*package name="\([^"]*\)".*/\1/'

These commands will show you all the packages available whether they are already installed or not. To list packages that are already installed there is a nifty little script that can be found here. Download mingw-get-info and copy it to /mingw/bin.

$ mingw-get-info installed

This script is not an official MinGW tool and seems to only exist as an attachment to the linked bug report. From the comments on that page the script will generate a number of reports:

$ mingw-get-info all

to see current status for all available packages,

$ mingw-get-info installed

to filter on only those packages which are installed locally, or

$ mingw-get-info index

to see an index for the repository catalogue.