install.nsi 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ; NOTE: this .NSI script is designed for NSIS v1.8+
  2. ; This also packages vcredist_x86.exe v9.0.30729.5677 (which includes the MSVCR90.dll v9.0.30729.6161)
  3. ; It can be downloaded from: http://www.microsoft.com/en-us/download/details.aspx?id=26368
  4. ; This only works for unicode Python 2.7.3/wxPython2.8.
  5. ; Verify which version of MSVCR90.dll you need using dependancy walker on your Python2x.exe
  6. ; Place the vcredist_x86.exe file into the ./build directory and this install does the rest
  7. Name "Twine 1.4.3"
  8. OutFile "dist\twine-1.4.3-win.exe"
  9. ; Some default compiler settings (uncomment and change at will):
  10. ; SetCompress auto ; (can be off or force)
  11. ; SetDatablockOptimize on ; (can be off)
  12. ; CRCCheck on ; (can be off)
  13. ; AutoCloseWindow false ; (can be true for the window go away automatically at end)
  14. ; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
  15. ; SetDateSave off ; (can be on to have files restored to their orginal date)
  16. RequestExecutionLevel highest
  17. InstallDir "$PROGRAMFILES\Twine"
  18. InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Twine" ""
  19. ;DirShow show ; (make this hide to not let the user change it)
  20. DirText "Choose which folder to install Twine into:"
  21. Section "" ; (default section)
  22. SetOutPath "$INSTDIR"
  23. ; add files / whatever that need to be installed here.
  24. ; see http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5
  25. File "dist\win32\*.pyd"
  26. File "dist\win32\*.zip"
  27. File "dist\win32\*.dll"
  28. File "dist\win32\twine.exe"
  29. File "dist\win32\gpl.txt"
  30. File /r "dist\win32\targets"
  31. File /r "dist\win32\icons"
  32. ; add Start Menu entries
  33. CreateDirectory "$SMPROGRAMS\Twine\"
  34. CreateShortCut "$SMPROGRAMS\Twine\Twine.lnk" "$INSTDIR\twine.exe"
  35. CreateShortCut "$SMPROGRAMS\Twine\Uninstall.lnk" "$INSTDIR\uninstalltwine.exe"
  36. ; add uninstall entry in Add/Remove Programs
  37. WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Twine" "" "$INSTDIR"
  38. WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Twine" "DisplayName" "Twine 1.4.3 (remove only)"
  39. WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Twine" "UninstallString" '"$INSTDIR\uninstalltwine.exe"'
  40. ; file association
  41. WriteRegStr HKCR ".tws" "" "Twine.Story"
  42. WriteRegStr HKCR "Twine.Story" "" "Twine Story"
  43. WriteRegStr HKCR "Twine.Story\DefaultIcon" "" "$INSTDIR\twine.exe,1"
  44. WriteRegStr HKCR "Twine.Story\shell\open\command" "" '"$INSTDIR\twine.exe" "%1"'
  45. !define SHCNE_ASSOCCHANGED 0x08000000
  46. !define SHCNF_IDLIST 0
  47. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
  48. ; write out uninstaller
  49. WriteUninstaller "$INSTDIR\uninstalltwine.exe"
  50. ; Install Visual Studio Redistributable controls
  51. File "build\vcredist_x86.exe"
  52. ExecWait '"$INSTDIR\vcredist_x86.exe" /qb!'
  53. Delete "$INSTDIR\vcredist_x86.exe"
  54. SectionEnd ; end of default section
  55. ; begin uninstall settings/section
  56. UninstallText "This will uninstall Twine 1.4.3 from your system."
  57. Section Uninstall
  58. ; add delete commands to delete whatever files/registry keys/etc you installed here.
  59. Delete "$INSTDIR\uninstalltwine.exe"
  60. DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Twine"
  61. DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Twine"
  62. DeleteRegKey HKCR ".tws"
  63. DeleteRegKey HKCR "Twine.Story"
  64. RMDir /r "$SMPROGRAMS\Twine"
  65. RMDir /r "$INSTDIR"
  66. SectionEnd ; end of uninstall section
  67. ; eof