From 684c6fad668e9a5573d8236e62fe015f0a507bd9 Mon Sep 17 00:00:00 2001 From: canni2007 Date: Sat, 3 Nov 2007 16:26:42 +0000 Subject: Updated Installer check routines jira:USDX-163 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1@570 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Installer/Readme.txt | 2 +- Installer/UltraStar Deluxe.nsi | 56 +++++++++++++++++++++++++++++---------- Installer/icons/uninstall.ico | Bin 0 -> 22486 bytes Installer/icons/ustar.ico | Bin 0 -> 22486 bytes Installer/settings/functions.nsh | 2 +- 5 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 Installer/icons/uninstall.ico create mode 100644 Installer/icons/ustar.ico (limited to 'Installer') diff --git a/Installer/Readme.txt b/Installer/Readme.txt index f3e72b98..5538e0a2 100644 --- a/Installer/Readme.txt +++ b/Installer/Readme.txt @@ -1,4 +1,4 @@ -SOURCE (3th of November 2007, 14:00 UTC+1 MESZ) +SOURCE (3th of November 2007, 17:30 UTC+1 MESZ) Build using Nullsoft Install System (http://nsis.sourceforge.net/) diff --git a/Installer/UltraStar Deluxe.nsi b/Installer/UltraStar Deluxe.nsi index b38f7ca3..296977f4 100644 --- a/Installer/UltraStar Deluxe.nsi +++ b/Installer/UltraStar Deluxe.nsi @@ -8,8 +8,8 @@ !include ".\settings\functions.nsh" !include "WinVer.nsh" -!define icon_inst "..\InstallerDependencies\icons\ustar.ico" ; Icon for Installation -!define icon_uninst "..\InstallerDependencies\icons\uninstall.ico" ; Icon for Uninstallation +!define icon_inst ".\icons\ustar.ico" ; Icon for Installation +!define icon_uninst ".\icons\uninstall.ico" ; Icon for Uninstallation SetCompress Auto SetCompressor /SOLID lzma @@ -65,6 +65,7 @@ SetDatablockOptimize On Name "${p_name} V.${version}" Brandingtext "${p_name} Installation" OutFile "Install ${p_name} V.${version}.exe" +!define ins_name "Install ${p_name} V.${version}.exe" InstallDir "$PROGRAMFILES\${p_name}" @@ -98,6 +99,10 @@ ShowUnInstDetails show !define MUI_STARTMENUPAGE_BGCOLOR "${smp_bgcolor}" ; RGB Background of Startmenu List and Textbox ;!define MUI_INSTFILESPAGE_COLORS "${dets_bgcolor}" ; Background Color of Details Screen while files are being extracted + +!define MUI_LANGDLL_WINDOWTITLE "USdx In-/Uninstaller: Choose language" +!define MUI_LANGDLL_ALWAYSSHOW + !define MUI_FINISHPAGE_NOAUTOCLOSE ; Allows user to check the log file of installation (Comment out if unwanted) !define MUI_UNFINISHPAGE_NOAUTOCLOSE ; Allows user to check the log file of uninstallation (Comment out if unwanted) @@ -109,13 +114,6 @@ ShowUnInstDetails show !define MUI_FINISHPAGE_SHOWREADME_TEXT $(sc_desktop) !define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortCuts -;Language Dialog Box Settings -;!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" -;!define PRODUCT_UNINST_ROOT_KEY "HKLM" -;!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" -;!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" -;!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language" - ; -------------------------------------------------- ; Begin of the installation routine ; -------------------------------------------------- @@ -494,23 +492,53 @@ SectionEnd ; Function for Installation Function .onInit - !insertmacro MUI_LANGDLL_DISPLAY + + System::Call 'kernel32::CreateMutexA(i 0, i 0, t "USdx Installer.exe") ?e' + + Pop $R0 + + StrCmp $R0 0 +3 + MessageBox MB_OK "The installer is already running." + Abort + + !insertmacro MUI_LANGDLL_DISPLAY + + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ + "UninstallString" + StrCmp $R0 "" done + + MessageBox MB_YESNO|MB_ICONEXCLAMATION \ + "${PRODUCT_NAME} is already installed. $\n$\nAre you sure you want to \ + install it again?" \ + IDYES done + Abort + + +done: + !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS ".\settings\settings-1031.ini" "Settings-1031" !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS ".\settings\settings-1033.ini" "Settings-1033" + FunctionEnd ; Function for Uninstallation Function un.onInit - loop: ${nsProcess::FindProcess} "USdx.exe" $R0 StrCmp $R0 0 0 +2 - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'UltraStar Deluxe cannot be uninstalled while its running!' IDOK loop IDCANCEL end + MessageBox MB_YESNO|MB_ICONEXCLAMATION 'UltraStar Deluxe cannot be uninstalled while its running! Do you want to close it?' IDYES closeit IDNO end + + closeit: + ${nsProcess::KillProcess} "USdx.exe" $R0 + goto continue - end: + end: ${nsProcess::Unload} + Abort + continue: + !insertmacro MUI_LANGDLL_DISPLAY - !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd \ No newline at end of file diff --git a/Installer/icons/uninstall.ico b/Installer/icons/uninstall.ico new file mode 100644 index 00000000..1c72432a Binary files /dev/null and b/Installer/icons/uninstall.ico differ diff --git a/Installer/icons/ustar.ico b/Installer/icons/ustar.ico new file mode 100644 index 00000000..f3214d1a Binary files /dev/null and b/Installer/icons/ustar.ico differ diff --git a/Installer/settings/functions.nsh b/Installer/settings/functions.nsh index a62b9137..147ec76c 100644 --- a/Installer/settings/functions.nsh +++ b/Installer/settings/functions.nsh @@ -52,7 +52,7 @@ FunctionEnd !macroend !define WriteToConfig "!insertmacro WriteToConfig" -; Finds and kills UltraStar Deluxe process +; Finds UltraStar Deluxe process ; !define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess` -- cgit v1.2.3