Changeset 190 for trunk/windows


Ignore:
Timestamp:
04/20/2009 10:41:27 AM (3 years ago)
Author:
guyru
Message:

Updated the nsis installer script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/windows/windows_installer.nsi

    r103 r190  
    66;  
    77;-------------------------------- 
    8 !define version 1.8 
     8!define version 1.9 
    99;-------------------------------- 
    1010;Include Modern UI 
    1111 
    12   !include "MUI.nsh" 
     12  !include "MUI2.nsh" 
    1313 
    1414;-------------------------------- 
    1515 
    1616; The name of the installer 
    17 Name "OpenYahtzee ${version}" 
     17Name "Open Yahtzee ${version}" 
    1818 
    1919; The file to write 
    20 OutFile "OpenYahtzee-${version}.exe" 
     20OutFile "openyahtzee-${version}.exe" 
    2121 
    2222; The default installation directory 
    23 InstallDir $PROGRAMFILES\OpenYahtzee 
     23InstallDir "$PROGRAMFILES\Open Yahtzee" 
    2424 
    2525;hides details of the install and uninstall but allows the users to see them if he wants 
     
    2929; Registry key to check for directory (so if you install again, it will  
    3030; overwrite the old one automatically) 
    31 InstallDirRegKey HKLM "Software\OpenYahtzee" "Install_Dir" 
     31InstallDirRegKey HKLM "Software\Open Yahtzee" "Install_Dir" 
    3232 
    3333; set the icon for installer 
     
    5555 
    5656; The stuff to install 
    57 Section "OpenYahtzee-${version} (required)" SecOpenYahtzee 
     57Section "Open Yahtzee-${version} (required)" SecOpenYahtzee 
    5858 
    5959  SectionIn RO 
     
    6464  ; Put file there 
    6565  File "openyahtzee.exe" 
    66   File "mingwm10.dll" 
    67   File "openyahtzee.exe.manifest" 
    6866  File "COPYING.txt" 
    6967  File "ChangeLog.txt" 
    70   File "icon32.ico" 
     68 
     69  ; Copy the runtime dlls 
     70  SetOutPath "$INSTDIR\Microsoft.VC90.CRT" 
     71  File "Microsoft.VC90.CRT\*.dll" 
     72  File "Microsoft.VC90.CRT\*.manifest" 
    7173   
    7274  ; Write the installation path into the registry 
    73   WriteRegStr HKLM SOFTWARE\OpenYahtzee "Install_Dir" "$INSTDIR" 
     75  WriteRegStr HKLM "Software\Open Yahtzee" "Install_Dir" "$INSTDIR" 
    7476   
    7577  ; Write the uninstall keys for Windows 
    76   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "DisplayName" "OpenYahtzee" 
    77   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "UninstallString" '"$INSTDIR\uninstall.exe"' 
    78   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "NoModify" 1 
    79   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "NoRepair" 1 
     78  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Yahtzee" "DisplayName" "Open Yahtzee" 
     79  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Yahtzee" "UninstallString" '"$INSTDIR\uninstall.exe"' 
     80  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Yahtzee" "NoModify" 1 
     81  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Yahtzee" "NoRepair" 1 
    8082  WriteUninstaller "uninstall.exe" 
    8183   
     
    8688  ; Remove old shortcuts, if any 
    8789  Delete "$SMPROGRAMS\OpenYahtzee\*.*" 
     90  Delete "$SMPROGRAMS\Open Yahtzee\*.*" 
    8891 
    89   CreateDirectory "$SMPROGRAMS\OpenYahtzee" 
    90   CreateShortCut "$SMPROGRAMS\OpenYahtzee\OpenYahtzee.lnk" "$INSTDIR\openyahtzee.exe" "" "$INSTDIR\icon32.ico" 0 
    91   CreateShortCut "$SMPROGRAMS\OpenYahtzee\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 
     92  CreateDirectory "$SMPROGRAMS\Open Yahtzee" 
     93  CreateShortCut "$SMPROGRAMS\Open Yahtzee\Open Yahtzee.lnk" "$INSTDIR\openyahtzee.exe" "" "$INSTDIR\openyahtzee.exe" 0 
     94  CreateShortCut "$SMPROGRAMS\Open Yahtzee\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 
    9295   
    9396SectionEnd 
     
    101104 
    102105  ;Language strings 
    103   LangString DESC_SecOpenYahtzee ${LANG_ENGLISH} "The OpenYahtzee game files and the required libraries." 
     106  LangString DESC_SecOpenYahtzee ${LANG_ENGLISH} "The Open Yahtzee game files and the required libraries." 
    104107  LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create shortcuts in the Start menu" 
    105108 
     
    117120   
    118121  ; Remove registry keys 
    119   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" 
    120   DeleteRegKey HKLM SOFTWARE\OpenYahtzee 
     122  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Yahtzee" 
     123  DeleteRegKey HKLM "SOFTWARE\Open Yahtzee" 
    121124 
    122125  ; Remove files and uninstaller 
    123126  Delete "$INSTDIR\openyahtzee.exe" 
     127  Delete "$INSTDIR\COPYING.txt" 
     128  Delete "$INSTDIR\ChangeLog.txt" 
     129  Delete "$INSTDIR\uninstall.exe" 
     130  Delete "$INSTDIR\Microsoft.VC90.CRT\*.*" 
     131  ; Remove old files 
    124132  Delete "$INSTDIR\openyahtzee.exe.manifest" 
    125133  Delete "$INSTDIR\mingwm10.dll" 
    126   Delete "$INSTDIR\COPYING.txt" 
    127   Delete "$INSTDIR\ChangeLog.txt" 
    128134  Delete "$INSTDIR\icon32.ico" 
    129   Delete "$INSTDIR\uninstall.exe" 
     135 
     136  RMDir "$INSTDIR\Microsoft.VC90.CRT" 
    130137  Delete "$INSTDIR\*" 
    131138 
     139 
    132140  ; Remove shortcuts, if any 
    133   Delete "$SMPROGRAMS\OpenYahtzee\*.*" 
     141  Delete "$SMPROGRAMS\Open Yahtzee\*.*" 
    134142 
    135143  ; Remove directories used 
    136   RMDir "$SMPROGRAMS\OpenYahtzee" 
     144  RMDir "$SMPROGRAMS\Open Yahtzee" 
    137145  RMDir "$INSTDIR" 
    138146 
Note: See TracChangeset for help on using the changeset viewer.