[Gaim-encryption-devel] Proposed changes for the NSIS script
Brought to you by:
obobo
|
From: <lu...@us...> - 2004-12-30 01:07:26
|
Hi Bill, Davy and others,
I have tested my own Win32 build of the 2.33cvs version with Gaim 1.1.1.
There have not been any troubles so far.
I think that the key deletition should be confirmed by the user in
another question dialog.
Have you ever seen someone sleeping on the keyboard? :)
The full key cache could be deleted by several unintentional keystrokes
or clicks.
The uninstall section of the gaim-encryption-installer.nsi is missing
several locales (cs,hu,ru,zh_TW).
I have changed this part of the script to be more dynamic with linguas
array delimited by a space.
The script deletes only our files so that the main Gaim resists damaged.
But the Gaim NSIS script is very destructive and deletes the full
locales tree: RMDir /r "$INSTDIR\locale". Maybe you could ask Gaim
developers to change it so that our installation would survive Gaim
reinstallations.
The proposed changes for the gaim-encryption-installer.nsi follows. The
script is a little commented so that anyone could step it through.
--- snip ----
cont_uninstall:
; plugin
Delete "$INSTDIR\plugins\encrypt.dll"
RMDir "$INSTDIR\plugins"
; all locales
Push $R0 ;save old values
Push $R1
Push $R2
Push "cs da de es fr hu it ja nl pl pt_BR ru sl zh_TW"
Pop $R0 ;initialize input array
alllinguas:
StrLen $R1 $R0 ;length of input array
IntCmp $R1 0 alldone
IntOp $R1 $R1 + 1
uptodelimiter:
IntOp $R1 $R1 - 1
IntCmp $R1 0 fullof fullof
StrCpy $R2 $R0 1 -$R1
StrCmp $R2 "" fullof
StrCmp $R2 " " partof
Goto uptodelimiter
partof:
StrCpy $R2 $R0 -$R1
IntOp $R1 $R1 - 1
StrCpy $R0 $R0 "" -$R1
Goto dodelwork
fullof:
StrCpy $R2 $R0
StrCpy $R0 ""
dodelwork:
StrCpy $R1 "$INSTDIR\locale"
Push $R1
StrCpy $R1 "$R1\$R2"
Push $R1
StrCpy $R1 "$R1\LC_MESSAGES"
Delete "$R1\gaim-encryption.mo"
RMDir $R1
Pop $R1
RMDir $R1
Pop $R1
RMDir $R1
Goto alllinguas
alldone:
Pop $R2 ;restore old values
Pop $R1
Pop $R0
; uninstaller shortcut
Delete "$SMPROGRAMS\Gaim\Gaim-Encryption Uninstall.lnk"
RMDir "$SMPROGRAMS\Gaim"
; uninstaller
Delete "$INSTDIR\${GAIM_ENCRYPTION_UNINST_EXE}"
; and the Gaim root, in case it has already uninstalled
RMDir "$INSTDIR"
Goto done
cant_uninstall:
--- snip ----
Lubos
|