On 2012-08-16 08:28, Ian Goldberg wrote:
I'll look into this on Monday when I get back from SAC.  But I have no
way to test it.  Would you be willing to do some rounds of tests with
me?
I have no problem assisting with testing.

To speed things along, I made a patch for the installer script that sets defaults for the MessageBox calls throughout the script.
The single-choice MessageBox-es simply acknowledge the message.
The Multiple-choice MessageBox-es default to the following:
"Are you sure you want to completely remove $(^Name) and all of its components?" -> YES "pidgin-otr.dll is busy. Please close Pidgin (including tray icon) and try again" -> CANCEL

The first default allows for silent removal by confirming the prompt on the user's behalf.
The second default prevents a loop on silent update if the DLL is in use.

I have built the NSI file into an installer and did some preliminary testing under the following scenarios (all on a clean VM with only Pidgin installed):
Install the OTR plugin (normal mode)
Uninstall the OTR plugin (normal mode)
Install the OTR plugin (silent mode)
Uninstall the OTR plugin (silent mode)
Update the OTR plugin (normal mode)
Update the OTR plugin (silent mode)
Uninstall the OTR plugin while Pidgin is running (normal mode)
Uninstall the OTR plugin while Pidgin is running (silent mode)
Update the OTR plugin while Pidgin is running (normal mode)
Update the OTR plugin while Pidgin is running (silent mode mode)

I have also verified that the installer aborts properly if Pidgin is not installed in both normal and silent modes.

My text editor converted a lot of spaces into tabs, so you may wish to make sure that your patching utility ignores whitespace changes in the context areas

Ariel Poliak
Network and Security Operations
Active Directory Administrator
HostDime.com, Inc.

diff U3wB ./pidgin-otr-3.2.1-old/packaging/windows/pidgin-otr.nsi 
./pidgin-otr-3.2.1-new/packaging/windows/pidgin-otr.nsi
--- ./pidgin-otr-3.2.1-old/packaging/windows/pidgin-otr.nsi     Mon May 14 
14:30:31 2012
+++ ./pidgin-otr-3.2.1-new/packaging/windows/pidgin-otr.nsi     Thu Aug 16 
17:31:35 2012
@@ -119,16 +119,15 @@
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
"DisplayVersion" "${PRODUCT_VERSION}"
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
"URLInfoAbout" "${PRODUCT_WEB_SITE}"
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" 
"${PRODUCT_PUBLISHER}"
- 
 SectionEnd
 
 Function un.onUninstSuccess
   HideWindow
-  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from 
your computer."
+       MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed 
from your computer." /SD IDOK 
 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
+       MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you 
want to completely remove $(^Name) and all of its components?" /SD IDYES IDYES 
+2
   Abort
 FunctionEnd
 
@@ -159,7 +158,7 @@
        IfFileExists "$PidginDir\plugins\pidgin-otr.dll" dodelete
   ReadRegStr $PidginDir HKCU Software\Pidgin-otr "pidgindir"
        IfFileExists "$PidginDir\plugins\pidgin-otr.dll" dodelete
-  MessageBox MB_OK|MB_ICONINFORMATION "Could not find pidgin plugin directory, 
pidgin-otr.dll not uninstalled!" IDOK ok
+       MessageBox MB_OK|MB_ICONINFORMATION "Could not find pidgin plugin 
directory, pidgin-otr.dll not uninstalled!" /SD IDOK IDOK ok
 dodelete:
        Delete "$PidginDir\plugins\pidgin-otr.dll"
 
@@ -177,7 +176,7 @@
        Pop $0
        
        IfFileExists "$PidginDir\plugins\pidgin-otr.dll" 0 +2
-               MessageBox MB_OK|MB_ICONINFORMATION "pidgin-otr.dll is busy. 
Probably Pidgin is still running. Please delete 
$PidginDir\plugins\pidgin-otr.dll manually."
+               MessageBox MB_OK|MB_ICONINFORMATION "pidgin-otr.dll is busy. 
Probably Pidgin is still running. Please delete 
$PidginDir\plugins\pidgin-otr.dll manually." /SD IDOK
 
   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "SOFTWARE\pidgin-otr\pidgindir"
@@ -191,11 +190,11 @@
        IfFileExists "$0\pidgin.exe" cont
        ReadRegStr $0 HKCU "Software\pidgin" ""
        IfFileExists "$0\pidgin.exe" cont
-  MessageBox MB_OK|MB_ICONINFORMATION "Failed to find Pidgin installation."
+               MessageBox MB_OK|MB_ICONINFORMATION "Failed to find Pidgin 
installation." /SD IDOK
                Abort "Failed to find Pidgin installation. Please install 
Pidgin first."
 cont:
        StrCpy $PidginDir $0
-       ;MessageBox MB_OK|MB_ICONINFORMATION "Pidgin plugin directory found at 
$PidginDir\plugins ."
+       ;MessageBox MB_OK|MB_ICONINFORMATION "Pidgin plugin directory found at 
$PidginDir\plugins ." /SD IDOK
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "SOFTWARE\pidgin-otr" "pidgindir" 
"$PidginDir"
 FunctionEnd
 
@@ -204,21 +203,25 @@
          ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
"UninstallString"
                IfFileExists "$0" deinst cont
        deinst:
-               MessageBox MB_OK|MB_ICONEXCLAMATION  "pidgin-otr was already 
found on your system and will first be uninstalled"
+               MessageBox MB_OK|MB_ICONEXCLAMATION  "pidgin-otr was already 
found on your system and will first be uninstalled" /SD IDOK
                ; the uninstaller copies itself to temp and execs itself there, 
so it can delete 
                ; everything including its own original file location. To 
prevent the installer and
                ; uninstaller racing you can't simply ExecWait.
                ; We hide the uninstall because otherwise it gets really 
confusing window-wise
                ;HideWindow
                  ClearErrors
+               IfSilent olduninstsilent
                        ExecWait '"$0" _?=$INSTDIR'
                        IfErrors 0 cont
-                               MessageBox MB_OK|MB_ICONEXCLAMATION  "Uninstall 
failed or aborted"
+                       MessageBox MB_OK|MB_ICONEXCLAMATION  "Uninstall failed 
or aborted" /SD IDOK
+                       Abort "Uninstalling of the previous version gave an 
error. Install aborted."
+olduninstsilent:
+               ExecWait '"$0" /S _?=$INSTDIR'
+               IfErrors 0 cont
                                Abort "Uninstalling of the previous version 
gave an error. Install aborted."
-                       
                ;BringToFront
        cont:
-               ;MessageBox MB_OK|MB_ICONINFORMATION "No old pidgin-otr found, 
continuing."
+               ;MessageBox MB_OK|MB_ICONINFORMATION "No old pidgin-otr found, 
continuing." /SD IDOK
                
 FunctionEnd
 
@@ -235,7 +238,7 @@
 IfErrors dllbusy
        Return
 dllbusy:
-       MessageBox MB_RETRYCANCEL "pidgin-otr.dll is busy. Please close Pidgin 
(including tray icon) and try again" IDCANCEL cancel
+       MessageBox MB_RETRYCANCEL "pidgin-otr.dll is busy. Please close Pidgin 
(including tray icon) and try again" /SD IDCANCEL IDCANCEL cancel
        Delete "$PidginDir\plugins\pidgin-otr.dll"
        Goto copy
        Return

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
OTR-dev mailing list
[email protected]
http://lists.cypherpunks.ca/mailman/listinfo/otr-dev

Reply via email to