Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. ; example2.nsi
  2. ;
  3. ; This script is based on example1.nsi, but it remember the directory,
  4. ; has uninstall support and (optionally) installs start menu shortcuts.
  5. ;
  6. ; It will install example2.nsi into a directory that the user selects,
  7. ; modded for black chocobo install
  8. ;--------------------------------
  9.  
  10. ; The name of the installer
  11. Name "Black Chocobo Installer"
  12.  
  13. ; The file to write
  14. OutFile "Black_Chocobo_Win32_Installer_v1.5.exe"
  15.  
  16. ; The default installation directory
  17. InstallDir $PROGRAMFILES\Black_Chocobo
  18.  
  19. ; Registry key to check for directory (so if you install again, it will
  20. ; overwrite the old one automatically)
  21. InstallDirRegKey HKLM "Software\Black_Chocobo" "Install_Dir"
  22.  
  23. ; Request application privileges for Windows Vista
  24. RequestExecutionLevel admin
  25.  
  26. ;--------------------------------
  27.  
  28. ; Pages
  29.  
  30. Page components
  31. Page directory
  32. Page instfiles
  33.  
  34. UninstPage uninstConfirm
  35. UninstPage instfiles
  36.  
  37. ;--------------------------------
  38.  
  39. ; The stuff to install
  40. Section "Install (required)"
  41.  
  42. SectionIn RO
  43.  
  44. ; Set output path to the installation directory.
  45. SetOutPath $INSTDIR
  46.  
  47. ; Put file there
  48. File "Black_Chocobo.exe"
  49. File "COPYING.txt"
  50. File "libgcc_s_dw-2-1.dll"
  51. File "mingwm10.dll"
  52. File /r lang\*.*
  53. File /r samples\*.*
  54.  
  55. ; Write the installation path into the registry
  56. WriteRegStr HKLM SOFTWARE\Black_Chocobo "Install_Dir" "$INSTDIR"
  57.  
  58. ; Write the uninstall keys for Windows
  59. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Black_Chocobo" "DisplayName" "Black Chocobo"
  60. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Black_Chocobo" "UninstallString" '"$INSTDIR\uninstall.exe"'
  61. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Black_Chocobo" "NoModify" 1
  62. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Black_Chocobo" "NoRepair" 1
  63. WriteUninstaller "uninstall.exe"
  64.  
  65. ;check for ff7 and write its installpath\save to "HKEY_CURRENT_USER\Software\blackchocobo\settings\export_pc and save_pc_path
  66. ${If} ${RunningX64}
  67. ReadRegStr $1 HKLM "SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII\" AppPath
  68. ${If} "$1" = ""
  69. MessageBox MB_OK "FF7 Install Path Not Found, Please Set Manually"
  70. ${EndIf}
  71. ${Else}
  72. ReadRegStr $1 HKLM "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\" AppPath
  73. ${If} "$1" != ""
  74. MessageBox MB_OK "FF7 Install Path Not Found, Please Set Manually"
  75. ${EndIf}
  76. ${EndIf}
  77. StrCpy $FF7INSTDIR $1
  78. SectionEnd
  79. WriteRegStr HKCU "Software\blackchocobo\settings""export_pc" '"$FF7INSTDIR\save"'
  80. WriteRegStr HKCU "Software\blackchocobo\settings""save_pc_path" '"$FF7INSTDIR\save"'
  81.  
  82. ; Optional section (can be disabled by the user)
  83.  
  84. Section "Start Menu Shortcuts"
  85.  
  86. CreateDirectory "$SMPROGRAMS\Black_Chocobo"
  87. CreateShortCut "$SMPROGRAMS\Black_Chocobo\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  88. CreateShortCut "$SMPROGRAMS\Black_Chocobo\Black_Chocobo (MakeNSISW).lnk" "$INSTDIR\Black_Chocobo.exe" "" "$INSTDIR\Black_Chocobo.exe" 0
  89.  
  90. SectionEnd
  91.  
  92. ;--------------------------------
  93.  
  94. ; Uninstaller
  95.  
  96. Section "Uninstall"
  97.  
  98. ; Remove registry keys
  99. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Black_Chocobo"
  100. DeleteRegKey HKLM SOFTWARE\Black_Chocobo
  101. DeleteRegKey HKCU "Software\blackchocobo"
  102.  
  103. ; Remove files and uninstaller
  104. Delete $INSTDIR\samples\*.*
  105. Delete $INSTDIR\lang\*.*
  106. Delete $INSTDIR\*.*
  107.  
  108.  
  109.  
  110. ; Remove shortcuts, if any
  111. Delete "$SMPROGRAMS\Black_Chocobo\*.*"
  112.  
  113. ; Remove directories used
  114. RMDir "$SMPROGRAMS\Black_Chocobo"
  115. RMDir "$INSTDIR\lang"
  116. RMDir "$INSTDIR\samples"
  117. RMDir "$INSTDIR"
  118.  
  119. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement