aboutsummaryrefslogtreecommitdiffstats
path: root/win32-installer.nsi
diff options
context:
space:
mode:
Diffstat (limited to 'win32-installer.nsi')
-rw-r--r--win32-installer.nsi12
1 files changed, 11 insertions, 1 deletions
diff --git a/win32-installer.nsi b/win32-installer.nsi
index a2262c0..24bbe6e 100644
--- a/win32-installer.nsi
+++ b/win32-installer.nsi
@@ -53,7 +53,7 @@ Function .onInit
; Look for Python system-wide (HKLM)
SetShellVarContext all
ReadRegStr $python_install_path SHCTX ${PYTHON_KEY} ""
- StrCmp $python_install_path "" 0 Continue
+ StrCmp $python_install_path "" 0 ContinueSystemWide
; Look for Python for the current user (HKCU)
SetShellVarContext current
@@ -63,6 +63,16 @@ Function .onInit
MessageBox MB_OK|MB_ICONSTOP "Unable to locate Python ${PYTHON_MAJOR}.${PYTHON_MINOR}."
Quit
+ ContinueSystemWide:
+ ; Python was installed for all users
+ ; The user needs to be an admin to install pyexiv2
+ userInfo::getAccountType
+ pop $0
+ StrCmp $0 "Admin" Continue 0
+
+ MessageBox MB_OK|MB_ICONSTOP "You need to be an administrator to install $(^Name)."
+ Quit
+
Continue:
StrCpy $system_wide "$python_install_pathLib\site-packages"
StrCpy $user_site "$APPDATA\Python\Python${PYTHON_MAJOR}${PYTHON_MINOR}\site-packages"