; datadesigner.nsi ; ; The name of the installer Name "DataDesigner" ; The file to write OutFile "datadesigner.exe" ; The default installation directory InstallDir $PROGRAMFILES\DataDesigner ; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) InstallDirRegKey HKLM SOFTWARE\DataDesigner "Install_Dir" ; The text to prompt the user to enter a directory ComponentText "This will install the DataDesigner on your computer. Select which optional things you want installed." ; The text to prompt the user to enter a directory DirText "Choose a directory to install in to:" ; The stuff to install Section "DataDesigner (required)" ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File "D:\cygwin\usr\src\datadesigner-0.4\src\datadesigner.exe" File "D:\cygwin\usr\src\datadesigner-0.4\xsl\pgsql.xsl" File "D:\cygwin\usr\src\datadesigner-0.4\xsl\db2.xsl" File "D:\cygwin\usr\src\datadesigner-0.4\xsl\mysql.xsl" File "D:\cygwin\usr\src\datadesigner-0.4\xsl\gen2pgsql.xsl" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\DataDesigner "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DataDesigner" "DisplayName" "DataDesigner (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DataDesigner" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" SectionEnd ; optional section Section "Start Menu Shortcuts" CreateDirectory "$SMPROGRAMS\DataDesigner" CreateShortCut "$SMPROGRAMS\DataDesigner\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\DataDesigner\DataDesigner.lnk" "$INSTDIR\datadesigner.exe" "" "$INSTDIR\datadesigner.exe" 0 SectionEnd ; uninstall stuff UninstallText "This will uninstall DataDesigner. Hit next to continue." ; special uninstall section. Section "Uninstall" ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DataDesigner" DeleteRegKey HKLM SOFTWARE\DataDesigner ; remove files Delete $INSTDIR\datadesigner.exe Delete $INSTDIR\pgsql.xsl Delete $INSTDIR\db2.xsl Delete $INSTDIR\mysql.xsl Delete $INSTDIR\gen2pgsql.xsl ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe ; remove shortcuts, if any. Delete "$SMPROGRAMS\DataDesigner\*.*" ; remove directories used. RMDir "$SMPROGRAMS\DataDesigner" RMDir "$INSTDIR" SectionEnd ; eof