Author: tyrell Date: Wed Aug 6 08:17:22 2008 New Revision: 20482 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=20482
Log: A potential fix for the shortcut uninstallation issue in Vista. Modified: trunk/mashup/java/modules/distribution/installer/mashupserver-setup.nsi Modified: trunk/mashup/java/modules/distribution/installer/mashupserver-setup.nsi URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/distribution/installer/mashupserver-setup.nsi?rev=20482&r1=20481&r2=20482&view=diff ============================================================================== --- trunk/mashup/java/modules/distribution/installer/mashupserver-setup.nsi (original) +++ trunk/mashup/java/modules/distribution/installer/mashupserver-setup.nsi Wed Aug 6 08:17:22 2008 @@ -13,10 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - + Name "WSO2 Mashup Server @mashup_version@" -# Product specific defines. Please provide appropriate data +# Product specific defines. Please provide appropriate data # in the build using ANT filters !define REGKEY "SOFTWARE\$(^Name)" !define VERSION_FOR_REGISTRY 0.3.0.0 #The version formatted in x.x.x.x format for the Windows Registry @@ -83,30 +83,32 @@ Section -Main SEC0000 # Checking the JRE and downloading the required one if necessary Call DetectJRE - + # Copying the distribution SetOutPath $INSTDIR - SetOverwrite on - File /nonfatal /r ${SERVER_BUILD_LOCATION}\*.* - + SetOverwrite on + File /nonfatal /r ${SERVER_BUILD_LOCATION}\*.* + # Copying the monitor icon SetOutPath $INSTDIR\bin\native - SetOverwrite on + SetOverwrite on File /nonfatal /r serverdown.ico - + WriteRegStr HKLM "${REGKEY}\Components" Main 1 SectionEnd Section -post SEC0001 + SetShellVarContext all + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR - SetOutPath $INSTDIR + SetOutPath $INSTDIR WriteUninstaller $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $SMPROGRAMS\$StartMenuGroup + SetOutPath $SMPROGRAMS\$StartMenuGroup CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Start $(^Name).lnk" "$INSTDIR\bin\native\wrapper-windows-x86-32.exe" "-t ..\..\conf\wrapper.conf" SetOutPath $INSTDIR\lib - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Start $(^Name) System Tray Monitor.lnk" "javaw.exe" '-jar "$INSTDIR\lib\${MONITOR_JAR_NAME}"' "$INSTDIR\bin\native\serverdown.ico" + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Start $(^Name) System Tray Monitor.lnk" "javaw.exe" '-jar "$INSTDIR\lib\${MONITOR_JAR_NAME}"' "$INSTDIR\bin\native\serverdown.ico" SetOutPath $INSTDIR CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe @@ -119,18 +121,18 @@ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 - + # Adding the System Tray Monitor to Startup - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name) Monitor" 'javaw.exe -jar "$INSTDIR\lib\${MONITOR_JAR_NAME}" -start "$INSTDIR"' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name) Monitor" 'javaw.exe -jar "$INSTDIR\lib\${MONITOR_JAR_NAME}" -start "$INSTDIR"' # Installing the Windows Service - ExecWait '"$INSTDIR\bin\native\wrapper-windows-x86-32.exe" -i ..\..\conf\wrapper.conf' + ExecWait '"$INSTDIR\bin\native\wrapper-windows-x86-32.exe" -i ..\..\conf\wrapper.conf' # Starting the Windows Service ExecWait '"$INSTDIR\bin\native\wrapper-windows-x86-32.exe" -t ..\..\conf\wrapper.conf' - - # Starting the System Tray Monitor + + # Starting the System Tray Monitor Exec 'javaw.exe -jar "$INSTDIR\lib\${MONITOR_JAR_NAME}" -start "$INSTDIR"' - + SectionEnd # Macro for selecting uninstaller sections @@ -147,34 +149,38 @@ !macroend # Uninstaller sections -Section /o -un.Main UNSEC0000 +Section /o -un.Main UNSEC0000 + SetShellVarContext all + # Showing a warning about script folder deletion MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "The '$INSTDIR\scripts' folder, which contains your Mashups \ will be deleted during uninstallation. If you would like to back up the folder contents, \ please do so before proceeding." IDOK ok IDCANCEL cancel - - ok: + + ok: # Un-installing the system tray monitor ExecWait 'javaw.exe -jar "$INSTDIR\lib\${MONITOR_JAR_NAME}" -stop' - - # Un-installing the windows service + + # Un-installing the windows service ExecWait '"$INSTDIR\bin\native\wrapper-windows-x86-32.exe" -r ..\..\conf\wrapper.conf' - - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Start $(^Name).lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Start $(^Name) System Tray Monitor.lnk" + + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Start $(^Name).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Start $(^Name) System Tray Monitor.lnk" RmDir /r /REBOOTOK $INSTDIR - DeleteRegValue HKLM "${REGKEY}\Components" Main + DeleteRegValue HKLM "${REGKEY}\Components" Main # Removing the System Tray Monitor from StartUp DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "$(^Name) Monitor" Goto done - + cancel: Quit - - done: + + done: SectionEnd Section -un.post UNSEC0001 + SetShellVarContext all + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" Delete /REBOOTOK $INSTDIR\uninstall.exe @@ -189,7 +195,7 @@ # Installer functions Function .onInit InitPluginsDir - StrCpy $StartMenuGroup ${START_MENU_GROUP} + StrCpy $StartMenuGroup ${START_MENU_GROUP} FunctionEnd # Uninstaller functions @@ -204,7 +210,7 @@ MessageBox MB_YESNO "$(^Name) uses Java ${JRE_VERSION}, or higher. \ The Setup did not detect an appropriate version in your system. \ Would you like Java ${JRE_VERSION} to be downloaded and installed?" IDYES yes IDNO no - + yes: StrCpy $2 "$TEMP\Java Runtime Environment.exe" nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2 @@ -218,29 +224,29 @@ no: MessageBox MB_OK|MB_ICONEXCLAMATION "The $(^Name) requires Java ${JRE_VERSION} or higher. \ Please ensure that a compatible Java version is installed and the JAVA_HOME environment variable is set." - + done: FunctionEnd - + # Detects the existing system JRE and matches it to the one required by the product Function DetectJRE ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ "CurrentVersion" StrCmp $2 ${JRE_VERSION} done # If 1.5 is there we're ok - StrCmp $2 "1.6" done # If 1.6 is there we're ok - + StrCmp $2 "1.6" done # If 1.6 is there we're ok + Call GetJRE - + done: Call SetJavaHome FunctionEnd # Checks whether the JAVA_HOME is set and Sets it if not Function SetJavaHome - ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "JAVA_HOME" + ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "JAVA_HOME" StrCmp $0 "" set Return - + set: ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\${JRE_VERSION}" "JavaHome" WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "JAVA_HOME" $1 _______________________________________________ Mashup-dev mailing list [email protected] http://mailman.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
