From f30f976f2dcc210ad39c7bc1926bfb12e7a8a52c Mon Sep 17 00:00:00 2001 From: lotus Date: Sat, 21 Jun 2008 08:42:06 +0000 Subject: [PATCH] installer downloads Java to shared documents and creates a shortcut on the desktop in case user is no admin git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4946 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- yacy.nsi | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/yacy.nsi b/yacy.nsi index 272c717df..30b648959 100755 --- a/yacy.nsi +++ b/yacy.nsi @@ -121,15 +121,28 @@ Section "Uninstall" SectionEnd Function GetJRE -; based on http://nsis.sourceforge.net/Simple_Java_Runtime_Download_Script - MessageBox MB_OK "YaCy uses Java ${JRE_VERSION6}. It will now be downloaded and installed." - - StrCpy $2 "$TEMP\Java Runtime Environment.exe" +; based on http://nsis.sourceforge.net/Simple_Java_Runtime_Download_Script + MessageBox MB_OK "YaCy uses Java ${JRE_VERSION6}. \ + It will now be downloaded and installed." + + userInfo::getAccountType + Pop $0 + StrCmp $0 "Admin" +3 + MessageBox MB_ICONEXCLAMATION "You need to install Java on Administrator privileges. \ + It will now be downloaded to the shared documents folder. \ + YaCy won't run without Java." + + SetShellVarContext all + StrCpy $2 "$DOCUMENTS\Java Runtime Environment (install for YaCy).exe" + SetShellVarContext current nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2 Pop $R0 ;Get the return value StrCmp $R0 "success" +3 MessageBox MB_OK "Download failed: $R0" Return + StrCmp $0 "Admin" +4 + CreateShortCut "$DESKTOP\Install Java for YaCy.lnk" "$2" + Return ; don't delete if not admin ExecWait $2 Delete $2 FunctionEnd