summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-05-02 14:59:25 -0400
committerLouie S <louie@example.com>2024-05-02 14:59:25 -0400
commit6fbda841a690ad046a3005d43e349915cf8e0810 (patch)
treefcd79ea8947c2a92996733603838d78230f4992a
parent7fce08d290c9dbe78f427913f66ac954bcd96733 (diff)
WIP researching dll locationing
-rwxr-xr-xnsis/find_dlls_wip.sh50
-rw-r--r--nsis/installer.nsi.in1
2 files changed, 50 insertions, 1 deletions
diff --git a/nsis/find_dlls_wip.sh b/nsis/find_dlls_wip.sh
new file mode 100755
index 0000000..dd6e927
--- /dev/null
+++ b/nsis/find_dlls_wip.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env sh
+
+# Proof-of-concept to have a script determine dlls that need to be shipped with the installer
+
+help() {
+ echo "Usage: [OPTION]... $0 BINARY..."
+ echo "Determine dlls required by BINARY (an .exe or .dll file)"
+ echo
+ echo "Options:"
+ echo " -h display this help message and exit"
+ echo " -s PATH set a path to search for dlls on. Default is \$PATH"
+}
+
+print_dlls() {
+ while [ -e "$1" ]; do
+ objdump -x "$1" | grep "DLL Name: " | sed 's/^[^D]*DLL Name: //'
+ shift
+ done
+}
+
+SEARCHPATH="$PATH"
+echo "$SEARCHPATH"
+
+# Check args
+while getopts "hs:" flag; do
+ case "$flag" in
+ h)
+ help
+ exit
+ ;;
+ s)
+ SEARCHPATH="${OPTARG}"
+ ;;
+ *)
+ break
+ esac
+done
+
+if [ -z "$1" ]; then
+ help
+ exit 1
+fi
+
+if [ ! -e "$1" ]; then
+ >&2 echo "Error: '$1' does not exist" > STDERR
+ exit 1
+fi
+
+print_dlls "$@"
+
diff --git a/nsis/installer.nsi.in b/nsis/installer.nsi.in
index a757628..b53f4cb 100644
--- a/nsis/installer.nsi.in
+++ b/nsis/installer.nsi.in
@@ -72,7 +72,6 @@ SectionEnd
Section "Uninstall"
Delete "$INSTDIR\@PACKAGE_NAME@.exe"
Delete "$INSTDIR\Uninstall.exe"
- ; FIXME directory is not being uninstalled
RMDir "$INSTDIR"
;DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
SectionEnd