!define GUIKACHU_TARGET "$PROGRAMFILES\Guikachu" !define GUIKACHU_INST "@PACKAGE@-@VERSION@-setup.exe" !define GUIKACHU_UNINST "$INSTDIR\@PACKAGE@-uninst.exe" !define GUIKACHU_UNINST_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" Name "Guikachu" OutFile "${GUIKACHU_INST}" SetCompressor /SOLID lzma InstallDir "${GUIKACHU_TARGET}" ;-------------------------------- ; Pages Page directory Page custom StartMenuGroupSelect "" ": Start Menu Folder" Function StartMenuGroupSelect Push $R1 StartMenu::Select /checknoshortcuts "Don't create a start menu folder" /autoadd /lastused $R0 "Guikachu" Pop $R1 StrCmp $R1 "success" success StrCmp $R1 "cancel" done ; error MessageBox MB_OK $R1 Return success: Pop $R0 done: Pop $R1 FunctionEnd Page instfiles ;-------------------------------- ; The stuff to install Section instfiles SetOutPath $INSTDIR SetOverwrite on File "guikachu.exe" File "guikachu2rcp.exe" ; write uninstaller SetOverwrite on WriteUninstaller "${GUIKACHU_UNINST}" SetOverwrite off ; Register uninstaller WriteRegStr HKCU "${GUIKACHU_UNINST_KEY}" "DisplayName" "Guikachu (Uninstall only)" WriteRegStr HKCU "${GUIKACHU_UNINST_KEY}" "UninstallString" "${GUIKACHU_UNINST}" ; Create start menu/desktop shortcuts StrCpy $R1 $R0 1 StrCmp $R1 ">" skip CreateDirectory "$SMPROGRAMS\$R0" CreateShortCut "$SMPROGRAMS\$R0\Guikachu.lnk" $INSTDIR\guikachu.exe CreateShortCut "$DESKTOP\Guikachu.lnk" $INSTDIR\guikachu.exe ;SetShellVarContext All ;CreateDirectory "$SMPROGRAMS\$R0" ;CreateShortCut "$SMPROGRAMS\$R0\Guikachu.lnk" $INSTDIR\guikachu.exe ;CreateShortCut "$DESKTOP\Guikachu.lnk" $INSTDIR\guikachu.exe skip: SectionEnd Section Uninstall ; Files RmDir /r "$INSTDIR\lib\locale" RmDir "$INSTDIR\lib" Delete "$INSTDIR\guikachu2rcp.exe" Delete "$INSTDIR\guikachu.exe" Delete "${GUIKACHU_UNINST}" RmDir "$INSTDIR" ; Shortcuts RMDir /r "$SMPROGRAMS\Guikachu" Delete "$DESKTOP\Guikachu.lnk" ;SetShellVarContext All ;RMDir /r "$SMPROGRAMS\Guikachu" ;Delete "$DESKTOP\Guikachu.lnk" ; Unreg package DeleteRegKey HKCU "${GUIKACHU_UNINST_KEY}" SectionEnd