A small gui improvement to metabrowser
[gmpc.git] / gmpc.nsi
blob571598ff6858e14d29244d79e72a4e0f44717eaf
1 ; gmpc.nsi
3 ; Gmpc installation script for NSIS installer compiler
4 ; By: Daniel Lindenaar <daniel-gmpc@lindenaar.org>
6 ;--------------------------------
8 Function .onInit
9 Push $R0
10 ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gmpc" "UninstallString"
11 StrCmp $R0 "" Gmpc_NOT_PRESENT
12 MessageBox MB_OK "Gmpc is already installed. Installation will be aborted."
13 Pop $R0
14 Abort
15 Gmpc_NOT_PRESENT:
16 Pop $R0
17 FunctionEnd
19 ; The name of the installer
20 Name "Gmpc"
22 ; The file to write
23 OutFile "gmpc_win32_installer.exe"
25 ; The default installation directory
26 InstallDir $PROGRAMFILES\gmpc
27 InstallDirRegKey HKLM "Software\gmpc" "InstallationDirectory"
28 ;--------------------------------
30 ; Pages
32 Page directory
33 Page instfiles
34 UninstPage uninstConfirm
35 UninstPage instfiles
36 ;--------------------------------
38 ; The stuff to install
39 Section "Install"
40 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gmpc" "DisplayName" "Gmpc simulation tool"
41 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gmpc" "UninstallString" '"$INSTDIR\uninstall.exe"'
42 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gmpc" "NoModify" 1
43 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gmpc" "NoRepair" 1
45 ; Set output path to the installation directory.
46 SetOutPath $INSTDIR
48 ; Put file there
49 File src\gmpc.exe
50 File libmpd-0.dll
51 File libregex.dll
52 SetOutPath $INSTDIR\data\glade
53 File glade\*.glade
54 SetOutPath $INSTDIR\data\images
55 File pixmaps\*.png
57 WriteRegStr HKLM "Software\gmpc" "InstallationDirectory" $INSTDIR
58 WriteUninstaller "$INSTDIR\Uninstall.exe"
60 SectionEnd ; end the section
62 Section "Uninstall"
63 RMDir /r $INSTDIR
64 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gmpc"
65 DeleteRegKey HKLM "Software\gmpc"
66 SectionEnd