Advertisement
Guest User

Untitled

a guest
May 14th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. !include "MUI2.nsh"
  2. !include "nsDialogs.nsh"
  3.  
  4. ;--------------------------------
  5. ; General Attributes
  6. Name "YT Channel Downloader"
  7. OutFile "ytchandl_installer.exe"
  8. InstallDir "$PROGRAMFILES\YT Channel Downloader"
  9. InstallDirRegKey HKLM "Software\YT Channel Downloader" "InstallDir"
  10. ShowInstDetails hide
  11. ShowUninstDetails hide
  12. BrandingText "QuickNode"
  13.  
  14. ;--------------------------------
  15. ; Variables
  16. Var DesktopShortcut
  17. Var StartMenuShortcut
  18.  
  19. ;--------------------------------
  20. ; Interface Settings
  21. !define MUI_ABORTWARNING
  22. !define MUI_ICON "icon.ico"
  23. !define MUI_UNICON "icon.ico"
  24.  
  25. ;--------------------------------
  26. ; Pages
  27. !insertmacro MUI_PAGE_WELCOME
  28. !insertmacro MUI_PAGE_DIRECTORY
  29. Page custom ShortcutPageCreate ShortcutPageLeave
  30. !insertmacro MUI_PAGE_INSTFILES
  31. !insertmacro MUI_PAGE_FINISH
  32. !insertmacro MUI_UNPAGE_CONFIRM
  33. !insertmacro MUI_UNPAGE_INSTFILES
  34. !insertmacro MUI_UNPAGE_FINISH
  35.  
  36. ;--------------------------------
  37. ; Languages
  38. !insertmacro MUI_LANGUAGE "English"
  39.  
  40. ;--------------------------------
  41. ; Installer Sections
  42. Section "Install"
  43. SetOutPath $INSTDIR
  44. File "ytchandl.exe"
  45. WriteUninstaller "$INSTDIR\uninstall.exe"
  46. SectionEnd
  47.  
  48. ;--------------------------------
  49. ; Description for Add/Remove Programs
  50. VIProductVersion "0.3.3.0"
  51. VIAddVersionKey "ProductName" "YT Channel Downloader"
  52. VIAddVersionKey "CompanyName" "QuickNode"
  53. VIAddVersionKey "FileDescription" "YT Channel Downloader Installer"
  54. VIAddVersionKey "FileVersion" "1.0.0.0"
  55. VIAddVersionKey "LegalCopyright" "Copyright © QuickNode 2023-2024. Licensed under the MIT License."
  56.  
  57. ;--------------------------------
  58. ; Uninstaller Sections
  59. Section "Uninstall"
  60. ; Remove shortcuts
  61. Delete "$DESKTOP\YT Channel Downloader.lnk"
  62. Delete "$SMPROGRAMS\YT Channel Downloader.lnk"
  63.  
  64. ; Remove files and uninstaller
  65. Delete "$INSTDIR\uninstall.exe"
  66. Delete "$INSTDIR\ytchandl.exe"
  67.  
  68. ; Remove registry keys
  69. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader"
  70. DeleteRegKey HKLM "Software\YT Channel Downloader"
  71.  
  72. ; Remove installation directory
  73. RMDir "$INSTDIR"
  74. SectionEnd
  75.  
  76. ;--------------------------------
  77. ; Functions for Shortcut Creation
  78. Function ShortcutPageCreate
  79. nsDialogs::Create 1018
  80. Pop $0
  81.  
  82. ${NSD_CreateCheckBox} 0 0 100% 10u "Create a Desktop shortcut"
  83. Pop $DesktopShortcut
  84.  
  85. ${NSD_CreateCheckBox} 0 12u 100% 10u "Create a Start Menu shortcut"
  86. Pop $StartMenuShortcut
  87.  
  88. nsDialogs::Show
  89. FunctionEnd
  90.  
  91. Function ShortcutPageLeave
  92. ${NSD_GetState} $DesktopShortcut $0
  93. StrCmp $0 ${BST_CHECKED} 0 +2
  94. StrCpy $DesktopShortcut "true"
  95.  
  96. ${NSD_GetState} $StartMenuShortcut $0
  97. StrCmp $0 ${BST_CHECKED} 0 +2
  98. StrCpy $StartMenuShortcut "true"
  99.  
  100. ; Create shortcuts if selected
  101. ${If} $DesktopShortcut == "true"
  102. CreateShortcut "$DESKTOP\YT Channel Downloader.lnk" "$INSTDIR\ytchandl.exe"
  103. ${EndIf}
  104.  
  105. ${If} $StartMenuShortcut == "true"
  106. CreateShortcut "$SMPROGRAMS\YT Channel Downloader.lnk" "$INSTDIR\ytchandl.exe"
  107. ${EndIf}
  108. FunctionEnd
  109.  
  110. ;--------------------------------
  111. ; Add uninstall information to registry
  112. Section -Post
  113. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader" "DisplayName" "YT Channel Downloader"
  114. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
  115. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader" "DisplayIcon" "$INSTDIR\ytchandl.exe"
  116. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader" "DisplayVersion" "0.3.3.0"
  117. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader" "Publisher" "QuickNode.net"
  118. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YT Channel Downloader" "EstimatedSize" 52041
  119. SectionEnd
  120.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement