!include MUI2.nsh ; I dub thee, MOON Installer! Name "MOON. English Localization" OutFile "[TLWiki]_MOON_English_v1.00a_.exe" InstallDir "$PROGRAMFILES\NEXTON\moon\" SetCompressor /FINAL /SOLID lzma RequestExecutionLevel admin ; -------------------------- ; MUI Interface Configuration ; -------------------------- ; Page Header !define MUI_ICON "wiki.ico" !define MUI_UNICON "wiki.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "header.bmp" ; (Un)Installer Welcome/Finish Page !define MUI_WELCOMEFINISHPAGE_BITMAP "welcome-fin.bmp" !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_UNFINISHPAGE_NOAUTOCLOSE ; Abort Warning !define MUI_ABORTWARNING !define MUI_UNABORTWARNING ; -------------------------- ; MUI Pages ; -------------------------- !define MUI_WELCOMEPAGE_TEXT "This NSIS Setup by TinFoil will ease the pain of a troublesome patch installation. Please direct all commentary/issues/anger towards TinFoil if you have problems with this exectuable's installation.$\n$\n\ Otherwise, have fun." !insertmacro MUI_PAGE_WELCOME !define MUI_LICENSEPAGE_TEXT_TOP "This isn't a license agreement, but a README instead. So read it." !define MUI_LICENSEPAGE_TEXT_BOTTOM "You need to read this fully and comprehensively in order to continue the MOON. English Localization." !define MUI_LICENSEPAGE_CHECKBOX !define MUI_LICENSEPAGE_CHECKBOX_TEXT "I acknowledge my stupidity if I ask a question already answered here." !insertmacro MUI_PAGE_LICENSE "readme.txt" !define MUI_COMPONENTSPAGE_NODESC !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ;Uninstall !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_DIRECTORY !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH !insertmacro MUI_LANGUAGE "English" SetOverwrite on ; -------------------------- ; Installation Begins Here ; -------------------------- SectionGroup /e "Translation" Section "Executable and Files" SetOutPath "$INSTDIR" File "MOON_eng.exe" ; Behold, a copypaste of the Windows API example, because this is some confusing shit. StrCpy $0 "$INSTDIR\moon.lst" StrCpy $1 "$INSTDIR\moon_jp.lst" StrCpy $2 1 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) l' StrCpy $0 "$INSTDIR\moon." StrCpy $1 "$INSTDIR\moon_jp" StrCpy $2 1 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) l' Rename "$INSTDIR\moon.lst" "$INSTDIR\moon_eng.lst" Rename "$INSTDIR\moon" "$INSTDIR\moon_eng" SectionEnd Section "Script and Images" SetOutPath "$INSTDIR\patch\" File "patch\*.*" SetOutPath "$INSTDIR" File "moon_patch.exe" File "Walkthrough.txt" ExecWait "$INSTDIR\moon_patch.exe" Delete "moon_patch.exe" RMDir /r "$INSTDIR\patch\" SectionEnd Section "Movies" SetOutPath "$INSTDIR\snd\" Rename "$INSTDIR\snd\op.avi" "$INSTDIR\snd\op_orig.avi" Rename "$INSTDIR\snd\start.avi" "$INSTDIR\snd\start_orig.avi" File "mjpg\op.avi" File "mjpg\start.avi" ; lol, Motion JPEG SectionEnd SectionGroupEnd SectionGroup /e "Shortcuts" Section "Start Menu" SetShellVarContext all CreateDirectory "$SMPROGRAMS\NEXTON\" CreateShortCut "$SMPROGRAMS\NEXTON\English MOON.lnk" "$INSTDIR\MOON_eng.exe" CreateShortCut "$SMPROGRAMS\NEXTON\English MOON. Walkthrough.lnk" "$INSTDIR\Walkthrough.txt" CreateShortCut "$SMPROGRAMS\NEXTON\English MOON. Uninstallation.lnk" "$INSTDIR\en-uninstall.exe" SectionEnd Section "Desktop" SetShellVarContext all CreateShortCut "$DESKTOP\English MOON.lnk" "$INSTDIR\MOON_eng.exe" CreateShortCut "$DESKTOP\English MOON. Walkthrough.lnk" "$INSTDIR\Walkthrough.txt" SectionEnd SectionGroupEnd Section WriteUninstaller "$INSTDIR\en-uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "DisplayName" "English MOON. v1.00" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "InstallLocation" "$\"$INSTDIR$\"" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "UninstallString" "$\"$INSTDIR\en-uninstall.exe$\"" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "Comments" "A english translation of the Japanese ADV, MOON." WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "HelpLink" "http://www.tsukuru.info/tlwiki/index.php?title=Talk:MOON." WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "URLInfoAbout" "http://www.tsukuru.info/tlwiki/index.php?title=MOON." WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "URLUpdateInfo" "http://www.tsukuru.info/tlwiki/index.php?title=MOON." WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "EstimatedSize" 0x0008bf92 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "NoModify" 0x0000001 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" "NoRepair" 0x0000001 SectionEnd ; -------------------------- ; Masaaki Endoh - UNINSTALL - ENSON ; -------------------------- Function un.onInit !insertmacro MUI_UNGETLANGUAGE FunctionEnd Section Uninstall Delete "$INSTDIR\moon_eng.exe" Rename "$INSTDIR\moon_jp.lst" "$INSTDIR\moon.lst" Rename "$INSTDIR\moon_jp" "$INSTDIR\moon" Delete "$INSTDIR\moon_eng.lst" Delete "$INSTDIR\moon_eng" Delete "$PROGRAMFILES\nexton\moon\Walkthrough.txt" Delete "$INSTDIR\snd\op.avi" Delete "$INSTDIR\snd\start.avi" Rename "$INSTDIR\snd\op_orig.avi" "$INSTDIR\snd\op.avi" Rename "$INSTDIR\snd\start_orig.avi" "$INSTDIR\snd\start.avi" SetShellVarContext all Delete "$SMPROGRAMS\NEXTON\English MOON.lnk" Delete "$SMPROGRAMS\NEXTON\English MOON. DVD.lnk" Delete "$DESKTOP\English MOON.lnk" Delete "$DESKTOP\English MOON. Walkthrough.lnk" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Eng_Moon" Delete "$INSTDIR\en-uninstall.exe" SectionEnd