; DNW.nsi ; ; This script is based on example1.nsi, but it remember the directory, ; has uninstall support and (optionally) installs start menu shortcuts. ; ; It will install DNW.nsi into a directory that the user selects. ; ; See install-shared.nsi for a more robust way of checking for administrator rights. ; See install-per-user.nsi for a file association example.
;--------------------------------
; The name of the installer Name "DNW"
; The file to write OutFile "DNWInstaller.exe"
; Request application privileges for Windows Vista and higher RequestExecutionLevel admin
; Build Unicode installer Unicode True
; The default installation directory InstallDir $PROGRAMFILES\DNW
; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) InstallDirRegKey HKLM "Software\DNW" "Install_Dir"
;--------------------------------
; Pages
Page components Page directory Page instfiles
UninstPage uninstConfirm UninstPage instfiles
;--------------------------------
; The stuff to install
Section "DNW (required)"
SectionIn RO
; Set output path to the installation directory. SetOutPath $INSTDIR
; Put file there File "DNW.exe" File "makeData.exe"
; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\DNW "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DNW" "DisplayName" "DNW" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DNW" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DNW" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DNW" "NoRepair" 1 WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section
SetOutPath "$INSTDIR\data" SetOverwrite on File /nonfatal /r "$data\*.*" AccessControl::GrantOnFile "$INSTDIR\data" "(S-1-1-0)" "FullAccess" AccessControl::GrantOnFile "$INSTDIR\data" "(S-1-5-32-545)" "FullAccess" # Give all authentificated users (BUILTIN\Users) full access on # the registry key HKEY_LOCAL_MACHINE\Software\DNW AccessControl::GrantOnRegKey \ HKLM "Software\DNW\data" "(BU)" "FullAccess" Pop $0