aboutsummaryrefslogtreecommitdiffstats
path: root/win32-installer.nsi
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-03-23 16:28:32 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-03-23 16:28:32 +0100
commit7c93f01f5e97ec892b059f7ea2cfe30e462b4c9b (patch)
tree2e48a1353347cd7cabb22b3314b7cf0bd0a78162 /win32-installer.nsi
parentd5363b165479b90a3bfbf27835b98a709a3dedc3 (diff)
downloadpyexiv2-7c93f01f5e97ec892b059f7ea2cfe30e462b4c9b.tar.gz
Refuse to install if Python was installed for all users and the user is not an admin.
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"