Automatically apply “git update-index –chmod=+x” to executable files

git 2.9.X/2.10 (Q3 2016) brings chmod to git add itself! See commit 4e55ed3 (31 May 2016) by Edward Thomson (ethomson). Helped-by: Johannes Schindelin (dscho). (Merged by Junio C Hamano — gitster — in commit c8b080a, 06 Jul 2016) add: add –chmod=+x / –chmod=-x options The executable bit will not be detected (and therefore will not … Read more

How do I find out which dlls an executable will load?

dumpbin is a tool that comes with VC++. To see what DLLs a program will import: Open Visual Studio Menu Item Tools | Visual Studio Command prompt cd to folder containing executable dumpbin /dependents whatever.exe Dump of file whatever.exe File Type: EXECUTABLE IMAGE Image has the following dependencies: AIOUSB.DLL sqlite3.dll wxmsw293u_core_vc_custom.dll wxbase293u_vc_custom.dll KERNEL32.dll ole32.dll OLEAUT32.dll … Read more

Getting the absolute path of the executable, using C#?

MSDN has an article that says to use System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase; if you need the directory, use System.IO.Path.GetDirectoryName on that result. Or, there’s the shorter Application.ExecutablePath which “Gets the path for the executable file that started the application, including the executable name” so that might mean it’s slightly less reliable depending on how the application was launched.

Adding multiple executables in CMake

My suggestion is to tackle this in two phases: Build a library from the .cpp and .h files, using add_library Iterate through all your .cxx files and create an executable from each, using add_executable and foreach Build the library This could be something as simple as file( GLOB LIB_SOURCES lib/*.cpp ) file( GLOB LIB_HEADERS lib/*.h … Read more

Running .sh scripts in Git Bash

Let’s say you have a script script.sh. To run it (using Git Bash), you do the following: [a] Add a “sh-bang” line on the first line (e.g. #!/bin/bash) and then [b]: # Use ./ (or any valid dir spec): ./script.sh Note: chmod +x does nothing to a script’s executability on Git Bash. It won’t hurt … Read more

Determining application path in a Python EXE generated by pyInstaller

I found a solution. You need to check if the application is running as a script or as a frozen exe: import os import sys config_name=”myapp.cfg” # determine if application is a script file or frozen exe if getattr(sys, ‘frozen’, False): application_path = os.path.dirname(sys.executable) elif __file__: application_path = os.path.dirname(__file__) config_path = os.path.join(application_path, config_name)

How to find out which version of the .NET Framework an executable needs to run?

Using Notepad, three decades old, 200kb in size, preinstalled tool: open application with notepad appname.exe, search for word framework, repeat last search with F3 until .NET Framework,version=vX.Y shows up if nothing found (versions below 3.0) search for v2. … still 100 times easier then installing gigabytes of dot net analyzer tools and garbage studios. update: … Read more

Running an outside program (executable) in Python?

If using Python 2.7 or higher (especially prior to Python 3.5) you can use the following: import subprocess subprocess.call(args, *, stdin=None, stdout=None, stderr=None, shell=False) Runs the command described by args. Waits for command to complete, then returns the returncode attribute. subprocess.check_call(args, *, stdin=None, stdout=None, stderr=None, shell=False) Runs command with arguments. Waits for command to complete. … Read more

Proper way to add svn:executable

You are right to use the svn property editing commands. The property is svn:executable. To add the “executable bit” in svn svn propset svn:executable on <list of files> To remove the “executable bit” in svn svn propdel svn:executable <list of files> The SVN documentation for this is located here. As far as not modifying the … Read more