releasing/cbrtools/group/cbr.preconfigure.nsh
author Bob Rosenberg <bob.rosenberg@nokia.com>
Wed, 28 Jul 2010 13:20:46 +0100
changeset 624 f70b728ea30c
parent 602 3145852acc89
permissions -rw-r--r--
Move sysdeftools from buildtools package into build package
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
# Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
###########################################################################################
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
#  CBR Tools handling
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
!define RELTOOLSKEY "SOFTWARE\Symbian\Release Tools"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
!define CBRTOOLSKEY "SOFTWARE\Symbian\Symbian CBR Tools"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
!define PRODUCT_UNINST_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
VAR CBRUNINSTALL
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
!macro CBRToolsNSISManualUninstall inVersion inPath
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
           SetShellVarContext current
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
           RMDir /r "$SMPROGRAMS\Symbian CBR Tools\${inVersion}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
           RMDir "$SMPROGRAMS\Symbian CBR Tools" ; delete if empty
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
           RMDir /r "${inPath}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
           DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}\Symbian CBR Tools ${inVersion}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
           DeleteRegKey HKLM "${CBRTOOLSKEY}\${inVersion}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
           DeleteRegKey /ifempty HKLM "${CBRTOOLSKEY}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
           Push "${inPath}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
           !insertmacro PathTypeRmvFromEnvVar "path" "${inPath}" ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
           !insertmacro SetShellVarCtxt
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
!macroend
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
!macro CBRToolsISManualUninstall inVersion inPath inUninstallKey
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
           RMDir /r "$SMPROGRAMS\Symbian OS Release Tools\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
           RMDir /r "${inPath}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
           ${If} "${inUninstallKey}" != ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
             DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}\${inUninstallKey}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
           ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
           DeleteRegKey HKLM "${RELTOOLSKEY}\${inVersion}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
           DeleteRegKey /ifempty HKLM "${RELTOOLSKEY}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
           DeleteRegKey /ifempty HKLM "SOFTWARE\Symbian"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
           Push "${inPath}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
           !insertmacro PathTypeRmvFromEnvVar "path" "${inPath}" ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
!macroend
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
Function CBRToolsPreConfigureFunction
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
exch $0 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
push $1 # counter
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
push $2 # version
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
push $3 # uninstall string
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
push $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
push $5
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
push $6
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
push $R0 # $ReplaceVer
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
push $R1 # $ReplaceKey
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
push $R2 # nsis installations found
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
push $R3 # install shield installations found
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
      StrCpy $CBRUNINSTALL "no"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
StrCpy $5 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
SectionGetFlags $0  $R0 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
IntOp $R0 $R0 & ${SF_SELECTED} 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
${If} $R0 == ${SF_SELECTED} 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
  StrCpy $R0 "Following CBR Tools version(s) are already installed: "
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
  StrCpy $R1 ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
  StrCpy $R2 "" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
  StrCpy $R3 ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
  StrCpy $6 ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
  StrCpy $1 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
  loop:           #check if there is install shield installation
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
    EnumRegKey $2 HKLM "${RELTOOLSKEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
    StrCmp $2 "" checkNsis
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
    IntOp $1 $1 + 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
    readregstr $3 HKLM "${RELTOOLSKEY}\$2" "Path"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
    StrCpy $R3 "1"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
    StrCpy $R0 "$R0$\r$\nVersion $2 is already installed in $3."
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
    GoTo loop
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
  checkNsis:    # check if there is NSIS installation
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
  StrCpy $4 $1  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
  StrCpy $1 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
  loop1:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
    EnumRegKey $2 HKLM "${CBRTOOLSKEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
    StrCmp $2 "" done
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
    IntOp $1 $1 + 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
    readregstr $3 HKLM "${CBRTOOLSKEY}\$2" "Path"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
    StrCpy $R2 "$R2-$2-"  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
    StrCpy $R0 "$R0$\r$\nVersion $2 is already installed in $3."
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
    GoTo loop1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
  done:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
    IntOp $1 $1 + $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
    ${If} $1 > 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
   
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
    ${If} $SILENT == "true"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
    ${AndIf} $DIALOGS == "false"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
      !insertmacro LogStopMessage "CBRTools (Release Tools) already installed. Stopping installation.\
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
      $\r$\nPlease uninstall CBRTools (Rlease Tools) before continuing " "${OTHER_ERROR}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
    ${Else}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
      MessageBox MB_YESNOCANCEL "$R0$\r$\n\
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
        Do you want to uninstall previous installation(s) before continuing?" IDYES continue IDNO finish 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
    ${EndIf} 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
      cancel:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
      StrCpy $5 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
      GoTo finish
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
      
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
      
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
      continue:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
      StrCpy $CBRUNINSTALL "yes"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
      
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
    ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
  finish:  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
  StrCpy $0 "$5"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
  pop $R3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
  pop $R2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
  pop $R1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
  pop $R0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
  pop $6
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
  pop $5
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
  pop $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
  pop $3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
  pop $2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
  pop $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
  exch $0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
FunctionEnd
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
Function CBRToolsPreviousUninstall
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
exch $0 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
push $1 # counter
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
push $2 # version
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
push $3 # uninstall string
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
push $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
push $5
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
push $6
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
push $R0 # $ReplaceVer
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
push $R1 # $ReplaceKey
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
push $R2 # nsis installations found
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
push $R3 # install shield installations found
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
${If} $CBRUNINSTALL == "yes"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
  #uninstall
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
  #Uninstall first all NSIS installations
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
  StrCpy $1 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
  EnumRegKey $2 HKLM "${CBRTOOLSKEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
  ${While} $2 != ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
        ReadRegStr $3 HKLM "${PRODUCT_UNINST_KEY}\Symbian CBR Tools $2" "UninstallString"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
        ReadRegStr $4 HKLM "${CBRTOOLSKEY}\$2" "Path"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
        ${If} $3 == "" #no uninstaller found
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
          StrCpy $6 "error"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
        ${Else}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
          IfFileExists $3 +2 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
          StrCpy $6 "error"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
        ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
        
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
          ${If} $SILENT == "false" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
          ${OrIf} $DIALOGS == "true"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
            Banner::show /NOUNLOAD /set 76 "Removing previous installation $2..." "Please wait."
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
          ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
          IfFileExists "$4\reltools.ini" 0 +3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
           CreateDirectory "$TEMP\sitk\$2\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
           CopyFiles /SILENT "$4\reltools.ini" "$TEMP\sitk\$2\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
          ${If} $6 == "error"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
            !insertmacro CBRToolsNSISManualUninstall "$2" "$4"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
          ${Else}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
            ClearErrors
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   181
            ExecWait '"$3" /S _?=$4\' ;$3: Uninstaller $4:installation path
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   182
            IfErrors +2 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   183
            RMDir /r $4 ; delete installation folder
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
          ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
          IfFileExists "$TEMP\sitk\$2\reltools.ini" 0 +4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
           CreateDirectory "$4"        
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
           CopyFiles /SILENT "$TEMP\sitk\$2\reltools.ini" "$4" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
           RMDir /r "$TEMP\sitk\$2\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
          ${If} $SILENT == "false" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
          ${OrIf} $DIALOGS == "true"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
            Banner::destroy
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
          ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
     #IntOp $1 $1 + 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
     EnumRegKey $2 HKLM "${CBRTOOLSKEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
  ${EndWhile}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  loop:           #check if there is install shield installation
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
  StrCpy $1 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   202
  StrCpy $R3 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   203
  EnumRegKey $2 HKLM "${RELTOOLSKEY}" $1 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
  ${While} $2 != ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
    ReadRegStr $3 HKLM "${RELTOOLSKEY}\$2" "Path"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
           CreateDirectory "$TEMP\sitk\InstallShield\$2\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
           IfFileExists "$3\reltools.ini" 0 +2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
           CopyFiles /SILENT "$3\reltools.ini" "$TEMP\sitk\InstallShield\$2\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
           FileOpen $4 "$TEMP\sitk\InstallShield\$2\dir.txt" "w"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
           FileWrite $4 "$3"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
           FileClose $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
    StrCpy $R3 "1"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
    IntOp $1 $1 + 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
    EnumRegKey $2 HKLM "${RELTOOLSKEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
  ${EndWhile}    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
      ${If} $R3 == "1" #Look for install shield installations to uninstall
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
        StrCpy $1 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
        StrCpy $6 ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
        EnumRegKey $2 HKLM "${PRODUCT_UNINST_KEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
        ${While} $2 != "" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
           ReadRegStr $3 HKLM "${PRODUCT_UNINST_KEY}\$2" "DisplayName"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
           ${If} $3 == "Release Tools"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
              ${ExitWhile}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
           ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
           IntOp $1 $1 + 1    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
           EnumRegKey $2 HKLM "${PRODUCT_UNINST_KEY}" $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
        ${EndWhile}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
        
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
        ${If} $2 == ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
          StrCpy $6 "error"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
        ${ElseIf} $3 == "Release Tools"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
          ReadRegStr $3 HKLM "${PRODUCT_UNINST_KEY}\$2" "UninstallString"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
          ${If} $3 == ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
            StrCpy $6 "error"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
          ${Else}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
            MessageBox MB_OK "InstallShield will be launched, please select <remove> and follow the wizard" /SD IDOK
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
            ExecWait $3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
          ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
        ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
        
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
        FindFirst $0 $4 "$TEMP\sitk\InstallShield\*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
        ${While} $4 != ""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
            ${If} $4 != "."
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
            ${AndIf} $4 != ".."
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
              IfFileExists "$TEMP\sitk\InstallShield\$4\dir.txt" 0 notfound
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
              FileOpen $3 "$TEMP\sitk\InstallShield\$4\dir.txt" "r"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
              FileRead $3 $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
              FileClose $3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
              
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
              ${If} $6 == "error"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
                !insertmacro CBRToolsISManualUninstall "$4" "$1" "$2"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
              ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
              
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
              IfFileExists "$TEMP\sitk\InstallShield\$4\reltools.ini" 0 notfound
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
              CreateDirectory "$1" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
              CopyFiles /SILENT "$TEMP\sitk\InstallShield\$4\reltools.ini" "$1" 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
              notfound:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
              
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
            ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
            FindNext $0 $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
        ${EndWhile}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
        FindClose $0   
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
      ${EndIf}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
      #uninstal
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
${EndIF}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
  pop $R3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
  pop $R2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
  pop $R1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
  pop $R0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
  pop $6
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
  pop $5
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
  pop $4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
  pop $3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
  pop $2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
  pop $1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
  pop $0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
FunctionEnd
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
!macro CBRToolsPreconfigure inSectionName
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
  push "${inSectionName}"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
  call CBRToolsPreConfigureFunction
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
!macroend