From d956c983d17e7903440b67d72f45b1793e93e808 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 31 Jan 2017 17:16:48 -0200 Subject: [PATCH] Atualizando empacotamento windows. --- win/pw3270.nsi.in | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 18 deletions(-) diff --git a/win/pw3270.nsi.in b/win/pw3270.nsi.in index 1be6c6a..fd8155c 100644 --- a/win/pw3270.nsi.in +++ b/win/pw3270.nsi.in @@ -96,7 +96,7 @@ SubSection "@PACKAGE@" SecMain #file "/oname=$INSTDIR\@localedir@\pt_BR\LC_MESSAGES\@PACKAGE@.mo" "..\.bin\Release\@localedir@\pt_BR\LC_MESSAGES\@PACKAGE@.mo" # Save DataDir - SetRegView 64 + SetRegView @WINARCH@ WriteRegStr HKLM "Software\@PACKAGE@" "datadir" "$INSTDIR" WriteRegStr HKLM "Software\@PACKAGE@" "appName" "$INSTDIR\@PACKAGE@.exe" @@ -173,37 +173,102 @@ SectionEnd Section "Uninstall" + # Always delete uninstaller first + delete $INSTDIR\uninstaller.exe + + # Set SMPROGRAMS and DESKTOP path + SetShellVarContext all + + # now delete installed files + delete $INSTDIR\@PACKAGE@.exe + + delete $SMPROGRAMS\@PACKAGE@.lnk + delete $DESKTOP\@PACKAGE@.lnk + + RMDir /r "$INSTDIR\locale" + RMDir /r "$INSTDIR\share" + RMDir /r "$INSTDIR\etc" + RMDir /r "$INSTDIR\plugins" + RMDir /r "$INSTDIR\sdk" + RMDir /r "$INSTDIR\gtk2-runtime" + + # Delete all files + delete "$INSTDIR\*.dll" + + # Remove registry + SetRegView 32 + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" + DeleteRegKey HKLM "Software\@PACKAGE@" + + SetRegView @WINARCH@ + DeleteRegKey HKLM "Software\@PACKAGE@" + + # Delete System libraries + delete $SYSDIR\libhllapi.dll + + RMDir /r "$INSTDIR" + SectionEnd Function .onInit -SetRegView @WINARCH@ + #---[ Verifica opção de instalação HLLAPI ]---------------------------------------------------------- + + Push $0 + + ${GetParameters} $R0 + ClearErrors + ${GetOptions} $R0 /HLLAPI= $0 -ReadRegStr $4 HKLM "Software\gtkwin\@GTK_MODVERSION@" "path" + ${if} $0 == "NO" -${if} $4 == "" + SectionGetFlags "${HLLAPIPlugin}" $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags "${HLLAPIPlugin}" $0 - SectionGetFlags "SecGTK" $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags "SecGTK" $0 + ${else} -${Else} + SectionGetFlags "${HLLAPIPlugin}" $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags "${HLLAPIPlugin}" $0 - ${if} ${FileExists} `$4\*.*` + ${EndIf} - SectionGetFlags "SecGTK" $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags "SecGTK" $0 + Pop $0 - ${Else} +!ifdef WITHGTK + + #---[ Verifica se precisa instalar GTK ]------------------------------------------------------------- + + SetRegView @WINARCH@ + + ReadRegStr $4 HKLM "Software\gtkwin\@GTK_MODVERSION@" "path" + + ${if} $4 == "" + + SectionGetFlags "SecGTK" $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags "SecGTK" $0 - SectionGetFlags "SecGTK" $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags "SecGTK" $0 + ${Else} - ${EndIf} + ${if} ${FileExists} `$4\*.*` -${EndIf} + SectionGetFlags "SecGTK" $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags "SecGTK" $0 + + ${Else} + + SectionGetFlags "SecGTK" $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags "SecGTK" $0 + + ${EndIf} + + ${EndIf} + +!endif FunctionEnd -- libgit2 0.21.2