Added files for using NSIS (http://nsis.sourceforge.net) as an alternative self-insta...
[blender.git] / release / windows / installer / 00.blender.nsi
1 ;
2 ; 00.blender.nsi
3 ;
4 ; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
5 ;
6 ; 09.02.2003    aphex (mediocre@mixmojo.com)
7 ;
8
9 Name "Blender"
10 Caption "Blender Installer"
11 OutFile "blender-installer-win32-2.26.exe"
12 Icon "00.installer.ico"
13
14 EnabledBitmap "00.checked.bmp"
15 DisabledBitmap "00.unchecked.bmp"
16
17 InstallDir "$PROGRAMFILES\Blender Foundation\Blender"
18
19 LicenseText "Please read and agree to the license below:"
20 LicenseData "..\..\text\copyright.txt"
21
22 Function .onInstSuccess
23         MessageBox MB_YESNO "Blender was successfully setup on your computer. Do you wish to start Blender now?" IDNO NoThanks
24                 ExecShell "open" '"$INSTDIR\blender-2.26.exe"'
25         NoThanks:
26 FunctionEnd
27
28 BrandingText "http://www.blender.org/bf"
29 ComponentText "This will install Blender 2.26 on your computer."
30
31 DirText "Use the field below to specify the folder where you want Blender to be copied to. To specify a different folder, type a new name or use the Browse button to select an existing folder."
32
33 Section "Blender-2.26 (required)"
34   ; Set output path to the installation directory.
35   SetOutPath $INSTDIR
36   ; Put file there
37   File ..\..\..\obj\windows\blender-2.26.exe
38   File ..\..\..\lib\windows\python\lib\python22.dll
39   File ..\..\text\copyright.txt
40   File ..\..\text\README
41   File ..\extra\help.url
42   ; Write the installation path into the registry
43   WriteRegStr HKLM SOFTWARE\BlenderFoundation "Install_Dir" "$INSTDIR"
44   ; Write the uninstall keys for Windows
45   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender226" "DisplayName" "Blender 2.26 (remove only)"
46   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender226" "UninstallString" '"$INSTDIR\uninstall.exe"'
47   WriteUninstaller "uninstall.exe"
48 SectionEnd
49
50 SectionDivider
51
52 Section "Start Menu Shortcuts"
53   CreateDirectory "$SMPROGRAMS\Blender Foundation\Blender\"
54   CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
55   CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\blender-2.26.lnk" "$INSTDIR\blender-2.26.exe" "" "$INSTDIR\blender-2.26.exe" 0
56   CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\README.lnk" "$INSTDIR\README" "" "" 0
57   CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\copyright.lnk" "$INSTDIR\copyright.txt" "" "$INSTDIR\copyright.txt" 0
58   CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\help.lnk" "$INSTDIR\help.url"
59   MessageBox MB_YESNO "Do you wish to create a shortcut on your desktop?" IDNO NoDeskShortcut
60       CreateShortCut "$DESKTOP\Blender-2.26.lnk" "$INSTDIR\blender-2.26.exe" "" "$INSTDIR\blender-2.26.exe" 0
61   NoDeskShortcut:
62 SectionEnd
63
64 UninstallText "This will uninstall Blender 2.26. Hit next to continue."
65
66 Section "Uninstall"
67   ; remove registry keys
68   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender226"
69   DeleteRegKey HKLM SOFTWARE\BlenderFoundation
70   ; remove files
71   Delete $INSTDIR\blender-2.26.exe
72   Delete $INSTDIR\python22.dll
73   Delete $INSTDIR\copyright.txt
74   Delete $INSTDIR\README
75   Delete $INSTDIR\uninstall.exe
76   ; remove shortcuts, if any.
77   Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
78   Delete "$DESKTOP\Blender-2.26.lnk"
79   ; remove directories used.
80   RMDir "$SMPROGRAMS\Blender Foundation\Blender"
81   RMDir "$SMPROGRAMS\Blender Foundation"
82   RMDir "$INSTDIR"
83 SectionEnd