Loading ...
Sorry, an error occurred while loading the content.

Re: [wuhu_software_group] Re: WUHU Latest Version Not Installing

Expand Messages
  • John Liss
    Sure. Use the SendMessage function. See: http://nsis.sourceforge.net/Winamp_Plugin_Installer_Scripts Sorta like this: (totally untested) !include
    Message 1 of 8 , Sep 29, 2010
    • 0 Attachment
      Sure. Use the SendMessage function.

      See:
      http://nsis.sourceforge.net/Winamp_Plugin_Installer_Scripts

      Sorta like this:  (totally untested)

      !include WinMessages.nsh

      !define PRODUCT_NAME "WUHU"
      !define PRODUCT_VERSION "x.04"
      !define PRODUCT_DIR_REGKEY "Software\WUHU\"

      ; MUI 1.67 compatible ------
      !include "MUI.nsh"

      ; MUI Settings
      !define MUI_ABORTWARNING
      !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
      !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

      ; Welcome page
      !insertmacro MUI_PAGE_WELCOME
      ; Instfiles page
      !insertmacro MUI_PAGE_INSTFILES
      ; Finish page
      !insertmacro MUI_PAGE_FINISH

      ; Uninstaller pages
      !insertmacro MUI_UNPAGE_INSTFILES

      ; Language files
      !insertmacro MUI_LANGUAGE "English"

      ; MUI end ------

      Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
      OutFile "Setup.exe"
      InstallDir "$PROGRAMFILES\WUHU"
      InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
      ShowInstDetails show
      ShowUnInstDetails show


      ; stolen from CloseWinamp: this will in a loop send the Winamp window the WM_CLOSE
      ; message until it does not find a valid Winamp window
      ; (should really protect against Winamp failing to exit!)
      ;
      Function CloseWuhu
        Push $5
        loop:
          FindWindow $5 "Wuhu"
          IntCmp $5 0 done
          SendMessage $5 16 0 0
          Sleep 100
          Goto loop
        done:
        Pop $5
      FunctionEnd

      ; The install stuff
      Section ""
          ; Is it running?...
          Processes::FindProcess "wuhu" ;without ".exe"
          StrCmp $R0 "1" p_isRunning p_isNOTRunning
         
          p_isRunning:
            ;Found it running try to close it..
            Call CloseWuhu
            Sleep 1000  ; small delay to make sure it unloads..
          p_isNOTRunning:
            ; nope didn't find it running continue...


        ; install the files...
        SetOverwrite on
        SetOutPath "$INSTDIR\" ; Files to extract
        SetOverwrite try
        File "H:\wuhu\wuhu.exe"  ; full path to source file
        File "H:\wuhu\some.dll"
        RegDLL "$INSTDIR\some.dll"
       

      SectionEnd



      Section -Post
        WriteUninstaller "$INSTDIR\uninst.exe"
        WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
        WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
        WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\wuhu.exe"
        WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
      SectionEnd




      Function un.onUninstSuccess
        HideWindow
        MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
      FunctionEnd

      Function un.onInit
        MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
        Abort
      FunctionEnd

      Section Uninstall
        delete  /REBOOTOK "$INSTDIR\uninst.exe"

        DetailPrint "Uninstalling Wuhu..."
      ;  DetailPrint "Stopping service..."  ; if we installed as such
      ;  SimpleSC::StopService "WUHU"

      ; make sure we are not running...

        DetailPrint "Killing wuhu .." 
        Processes::KillProcess "wuhu"
        sleep 500


      ; clean up our installed files, remember to add down here if you add above
       
        UnRegDLL "$INSTDIR\some.dll"
        delete  /REBOOTOK "$INSTDIR\some.dll"
        delete  /REBOOTOK "$INSTDIR\WUHU.exe"

        RMDir /REBOOTOK "$INSTDIR"

        DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
        DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
       
        IfRebootFlag r_boot nr_boot
       
        r_boot:
          MessageBox MB_OKCANCEL "You must now reboot your system to complete the uninstall." IDCANCEL end
          Reboot
        goto end
       
        nr_boot:
        end:

        SetAutoClose true
      SectionEnd




      On 9/29/2010 12:12 PM, wuhu_software wrote:
      Do you know if there is a way to send a "Close" windows message if a process is running?
      
      Other than registering a DLL and OCX object or two, that is all I really need.
      
      Thanks.
      
      
      --- In wuhu_software_group@yahoogroups.com, John Liss <john@...> wrote:
      
      
      Take a look at Nullsoft installer.  It kicks butt.
      You can shutdown processes, services, etc.
      
                DetailPrint "Stopping SLClient service..."
                SimpleSC::StopService "SLClient"
                sleep 5000
                DetailPrint "Removing SLClient service..."
                SimpleSC::RemoveService "SLClient"
                sleep 2000
                DetailPrint "Killing slagent and slclient..."
                Processes::KillProcess "slagent"
                Processes::KillProcess "slclient"
                Processes::KillProcess "slstart"
                sleep 5000
      
      
      http://nsis.sourceforge.net/Download
      
      I use it all the time to register dll's.
      
      Make sure you grab the editor too.
      http://hmne.sourceforge.net/
      
      If you decide to use nullsoft, I'm pretty apt at getting stuff done in 
      it now days.
      
      -John
      
      On 9/29/2010 5:24 AM, wuhu_software wrote:
      
      Mike,
      
      Thanks for the tip.
      
      I have looked at a few of the installers. Most of the freeware versions do not allow for registering COM components which is something I need to do.
      
      The other feature I need is to be able to send a close command to instances of WUHU that are running before the installer proceeds.
      
      I have heard of the Nullsoft installers and others that are open source and completely free, the only problem there is finding the time to learn the scripting languages, etc.
      
      
      --- In wuhu_software_group@yahoogroups.com, "mikedw5071"<mike.christianson@>  wrote:
      
      When you find the time, have a look at Advanced Installer.  http://www.advancedinstaller.com/  I like it; we use it at work.  They have a free version which should be sufficient for (y)our needs.
      
      It's easy to use, but let me know if you end up needing any help.
      
      --- In wuhu_software_group@yahoogroups.com, "H. Smith"
      
      I will move to a new installer when I have the time but for now, try the following.
      
      
      
      ------------------------------------
      
      To visit your group on the web, go to:
      http://groups.yahoo.com/group/wuhu_software_group/
      
      Want more or less group messages (Special notices as a minimum)?http://groups.yahoo.com/group/wuhu_software_group/join
      
      To unsubscribe from this group, send an email to:
      wuhu_software_group-unsubscribe@yahoogroups.com
      
      WUHU Download page:
      http://home.comcast.net/~wuhu_software/Yahoo! Groups Links
      
      
      
      
      
      
      
      ------------------------------------
      
      To visit your group on the web, go to:
      http://groups.yahoo.com/group/wuhu_software_group/
      
      Want more or less group messages (Special notices as a minimum)?http://groups.yahoo.com/group/wuhu_software_group/join
      
      To unsubscribe from this group, send an email to:
      wuhu_software_group-unsubscribe@yahoogroups.com
      
      WUHU Download page: 
      http://home.comcast.net/~wuhu_software/Yahoo! Groups Links
      
      <*> To visit your group on the web, go to:
          http://groups.yahoo.com/group/wuhu_software_group/
      
      <*> Your email settings:
          Individual Email | Traditional
      
      <*> To change settings online go to:
          http://groups.yahoo.com/group/wuhu_software_group/join
          (Yahoo! ID required)
      
      <*> To change settings via email:
          wuhu_software_group-digest@yahoogroups.com 
          wuhu_software_group-fullfeatured@yahoogroups.com
      
      <*> To unsubscribe from this group, send an email to:
          wuhu_software_group-unsubscribe@yahoogroups.com
      
      <*> Your use of Yahoo! Groups is subject to:
          http://docs.yahoo.com/info/terms/
      
      
    Your message has been successfully submitted and would be delivered to recipients shortly.