summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-09-19 12:39:22 -0700
committerTor Norbye <tnorbye@google.com>2013-09-19 12:40:05 -0700
commitbeca9839b2866f90da9dc517c29df2ec25a6f6a8 (patch)
tree747d1f98670ee652ac6637ad488124760b2ac489 /build
parenta28de544d7f6bae0c637a1f8175ea613a976c52e (diff)
downloadidea-beca9839b2866f90da9dc517c29df2ec25a6f6a8.tar.gz
Snapshot 09776de1457414bbc7dc8a09e242de80e282d7dc from idea/132.325 of git://git.jetbrains.org/idea/community.git
09776de: IDEA-97132 "Building Gradle project info" dialog is modal and non-cancelable 8013ffd: Merge remote-tracking branch 'origin/master' 870d88c: IDEA-113775 External System: new 'Refresh external project' action for single module refresh; shortcut changed to "use-shortcut-of='Refresh'" 8c31855: JediTerm jars updated. 6e01d2c: remove unused dependency of dvcs on groovy 206b35f: allow to filter out inspection highlight infos (IDEA-113738) 0b123a7: pass PsiElement to be able to filter out specific highlight infos based on location (IDEA-113738) 85ca653: do we have java.applet in mockjdk now? 7c0ff90: more diagnostics in buildModulesAndCollectUsedJars() a99e7af: NSIS build scripts moved to community 3f2c72f: robust removeAllBreakpoints catch error while open new tab (attach debugger) Chrome still crashed on speed search in Variable View. bedb5d8: move NsiFiles helper task to community 26e1d16: new inference: do not imply constraints for proper types e273976: new inference: null upper bounds 278120e: move DefaultColorScheme* stuff to editor-ui-ex module e0ed326: Add reference for dependenciesToScan parameter of maven-surefire-plugin 79f4809: IDEA-112202 Ability to open surefire-reports in tests view like Eclipse does Add reference to open test result folder a0d65ce: IDEA-113766 Incorrect font width calculation in text area 44e095e: fix Terminal issues 34b1575: new project wizard: fixing layout problems 077e89f: IDEA-98656 Java doc not generated when an other Java doc has been commented after. 1554b75: IDEA-113604 Error suppression does not stop freemarker validator 5c0d022: IDEA-113596 Can't copy "About" details while indexing a645075: use optimized changes calculation always and only report different values in case of EAP mode c37d75d: IDEA-113581 Gradle: New Project Wizard: it could be possible to enable "Use default gradle wrapper" option 3b277d2: new project wizard: fixing layout problems 6e39762: new project wizard: hiding the "select desired technologies" label 5c1c1b0: new inference: infer from condition 052290e: NPE c1137ac: new inference: promote extends bounds to lower level 6950859: new inference: accept bounds with recursive dependency 92f6ae2: new inference: open top level captured wildcards 1622968: new inference: use dependant variables instantiations when resolve bounds e980a77: IDEA-113581 Gradle: New Project Wizard: it could be possible to enable "Use default gradle wrapper" option b3d49a4: IDEA-113775 External System: new 'Refresh external project' action for single module refresh c0afc26: fix stringWidth on non Retina devices e5781d7: IDEA-110452 Darcula theme causes font size increase 92b5fac: Don't add actions without icons to the file history toolbar 95df681: new project wizard: AddSupportForFrameworksPanel reused bcd0639: EA-49794 - NPE fix fcde853: Gradle: vmOptions provisioning fix 83ef088: IDEA-113199 Grails Plugins manager uses application.properties instead of BuildConfig.groovy Disable Grails plugin dialog for Grails 2.3.0 cae8718: platform: detect case-only name changes e19b820: Cleanup (minor refactoring and optimization) 620b9a1: common super-class extracted for library-based frameworks 60b4a4c: unnecessary intermediate class removed fdec7af: deprecate RoamingTypeExtensionPoint 09faeb9: deprecate RoamingTypeDisabled 2bdc447: [Serega Vasiliev] don't share statistics.application.usages.xml d8c1328: new StreamProvider API: client must not worry about supplementary files (version files for example) cd5f5bf: we don't need to manage list of stream providers, one is enough 3e0ccdd: unused import removed a49963f: Gradle: vmOptions provisioning fix e39cc01: IDEA-113448 Ability to create tests for inner classes 8f64aec: IDEA-113581 Gradle: New Project Wizard: it could be possible to enable "Use default gradle wrapper" option 2ff3757: xdebugger: implemented standalone variables view 93a2c9e: xdebugger: debugger trees decoupled from XDebugSession 7469f4b: notnullification 58c7e6e: hide flex modules from 'available elements' tree in artifact editor c6e955e: ability to cancel write to local file 6999b95: icon classes regenerated: copyright added to generated files, more instructive comment added 4583d6d: action component should be transparent b966b4e: IDEA-96724 Unable to clear Recent Projects list anymore 36c939f: do not handle SelectAll 9007f1e: Merge remote-tracking branch 'origin/master' 0c020d5: JediTerm jars updated. bdd7827: IDEA-98275 (Inspection "Unused assignment" does not work with the += operator) 2366f48: reduce flashes in lens mode da1f984: Lense mode patches&fixes (still internal mode only) 2926b90: unescape unicode escape sequences with a selection 33917b2: Merge remote-tracking branch 'origin/master' db74d04: cleanup aa8b725: keep apple.awt dependencies to util module f5b050d: dfa: boxed/unboxed values are also unknown 68499e9: re: tina 7db91db: For 'normal indices' schedule the file for update and reset stamps for all affected indices (there can be client that used indices between before and after events, in such case indices are up to date due to force update with old content) cee92af: WEB-1212 Add actions "expand children" and "expand descendants" in object variable context menu in JS debug Actually, we don't add such actions, but now speed search can expand nodes. 491868c: Tests updated for system dependent problems. b32093e: Fix 'compare with' on windows for file history. b4e6e2e: IDEA-113622 IDEA-101040 Throw assertion error + add a javadoc 02f8059: groovy for groovy shell 34464a1: cleanup a5c6842: Platform: more precise string version comparison +review CR-OC-818 c5daac1: Merge remote-tracking branch 'origin/master' c9e64f9: Merge branch 'svn1_8_new' 88df6b0: fix dfa false positive in JSTypeofTypeImpl 0a8c128: DfaMemoryStateImpl: use only non-trivial equality classes for comparison fb5e43a: IDEA-94942 Do not add '@' to the path end if no peg revision specified and path does not contain '@' 6eec3b3: IDEA-113725 Remove adding '@' to the checkout destination folder path end 88a8cc6: Enable action for generic fileEditors (non-text) & cleanup 9f1e568: fix NPE on startup with empty configs 57ec7ae: IDEA-108294 every time I open project — it is collapsed to (0.0) fda2edf: IDEA-103303 "BeforeLaunch" tools in run/debug configurations do not do macro substitution (After review http://crucible.labs.intellij.net/cru/CR-IC-2352) 1b52604: new titled renderer 01db28a: rollback 6e2e668: fix stringWidth on Windows 016affd: setup AA as well as fractional metrics b60b5ae: + custom foreground as a parameter e07e365: remove useless warning "Client-side debugging is available in Chrome and Firefox only" 5a773cb: IDEA-113719 Ide frame collapses if a project has been saved with maximised frame on Mac OS X and jdk7 2c7c801: WEB-9277 Exception when startup page in config doesn't start with http:// bad42ce: resource roots: added button to mark directory as a resource root to the toolbar of 'Sources' tab in module editor 82869db: simplification 92ba709: StartBrowserPanel UI fixed after kb review — "Start Browser" checkbox renamed to "After launch", don't disable all panel controls on unselect this checkbox remove label for URL field fix combobox text baseline (only Mac&Acua LAF, other LAFs are not checked) c495a55: cleanup e810a1d: new StreamProvider API: saveContent accept byte[] instead of InputStream 48c3963: hash as primitive int, saveForProviders - avoid document copy e4e62de: IDEA-113678 NPE in external Make with Eclipse compiler 1e0f096: IDEA-95943 Mac OS X, application menu disappears for project sometimes daad75e: Minor code change: optimization 9872570: EA-37570 - IAE: MavenRootModelAdapter.addModuleDependency c110f6a: added icons for resource roots 87a043e: temporary exclude darcula icons from generation 092a4c0: icons classes generation: 'external-system' module migrated to use generated class 2c4952d: Merge remote-tracking branch 'origin/master' dc39410: IDEA-71176 Encapsulate Java fields should update Groovy usages 5de8769: EA-48031 - assert: PsiJavaCodeReferenceElementImpl.diagnoseUnknownParent d2f8238: EA-47448 - SOE: remove GPP traits which cause SOE 3e1a9aa: encode only known references d15350e: batch highlighter dispose requests 2c2111f: avoid deprecated methods ed104a4: refresh todo configuration on color scheme change 02bfaee: cleanup ee5cc85: NPE 17ec6e7: cleanup 2c44b32: visibility 7a12666: AllIcons class regenerated: copyright removed b724720: delete outputs corresponding to changed files for each target before running builders on it f2cb5f3: new inference: initial lambda 0959d41: new inference: delayed constraints 74364db: new inference: accept all new expressions when diamond is checked to support collapse checks 7a06e5d: platform: less Win32 FS cache misses 2fe6eea: EA-47867 (keep order of path macros) 24caf16: Cleanup (unneeded qualifier) cae47e4: model: meaningful macro name assertion cdc9cc1: Cleanup (typos) cf7580c: tests framework: project descriptor creation eased 2d83d16: tests: nothing to present for the public 24f5418: IDEA-113686 Unable to debug gradle tests when -Dtest.single is used c42bb71: correctly handle case changes in resource files for case-insensitive file systems: ensure case of the output file is exactly the same as the case of the source file 6375979: new inference: typo b6d38c0: new inference with diamonds: find in map by context arguments 46e8363: diamonds: unify substitutor calculation 4c9117d: class moved to proper source root d831db7: icons classes generation: fixed regex processing in icon-robots.txt files, android finally excluded from generation 0a73b24: icon classes regenerated; please don't modify icons classes by hand, use icons.gant instead 2920a3e: EA-50043 - UOE: BaseGenerateTestSupportMethodAction$MyHandler.invoke addc304: inspection profile: allow to change inspection settings from quick fix - profileChanged would force diff to default recalculation (IDEA-113650) 39e0079: NPE c20b88c: new inference: fix subtyping direction 005a409: new inference: incomplete exprs 7b431f4: new inference: wildcard bounds could mention type vars aa8f107: StorageUtil.documentToBytes - we should use standard line-separator (\n) - stream provider can share file content on any OS Only stream provider — in case of local file we use system line separator as before 592744f: cleanup 63d4c9b: component version as TObjectLongHashMap fe5954c: cleanup a109761: IDEA-103303 "BeforeLaunch" tools in run/debug configurations do not do macro substitution 6656c26: remove white stripe under Aqua 4cba712: IDEA-113617 (Inspection "Comparator class not declared serializable" proposes wrong modification for extending interface.) 2253395: new StreamProvider API: saveContent accept size as int, listSubFiles returns Collection<String> instead of String[], default impl listSubFiles moved to interface class use new StreamProvider API in ICS plugin fd10033: building searchable options should also be available in community build scripts c142fea: extract a useful function from ultimate build script 7e43f9c: make peter less worried b3ac677: dfa: closure states have empty stack initially c8e66db: flush code block variables when leaving it via exception route d046951: dfa: don't create negated value just to flush it 36a4b9b: DfaVariableValue: not-null psi, store qualified references in the value itself 2401bcc: DfaVariableValue: cheaper creation, cache negated var 67ecf76: a more explicit CommandLog category 3aa48b4: Use JBColor. c33135a: VCS: improve ChangesTreeList selection in Tree mode ec73fec: StartBrowserPanel & JS Debug RC editor — unified url text field 450ff3c: Merge remote-tracking branch 'origin/master' c9064eb: Merge branch 'svn1_8_new' d89ff92: new inference: find method by arg list fixed dcdaebd: new inference: process all vararg args to gather constraints 903f47b: new inference: stop when bound set is fully inferred 2198276: new inference: subtyping with anonymous fixes b36107d: new inference: exclude return type constraint from applicability check e2ee888: new inference: reuse getTargetType initial e6d1b14: new inference: do not infer non-generics calls 48e206d: new inference: equals & hashCode 314333d: IDEA-94942 Make svn command line implementation always use "interactive authentication" (fixes error when "passive authentication" was applied on some threads where thread local storage was not correctly cleared) f3ba5c7: cleanup, apply on name change fix & NPE fix 1b15d56: assertion fix d12f8f3: bigger font size in Project View d78422c: IDEA-94942 Use move destination as working directory for "svn move" command (not to lock source directory by running process) 3d8cdeb: should be undo/redo in TextFieldWithBrowseButton 7b3500d: move StartBrowserSettings to xml module, use our robust Url instead of java URI 8f9926f: IDEA-102165 android xml: show icons and quickdoc for views in code completion 5eea60f: IDEA-113664 Do not use '@' (for peg revision) at the end of move destination a17d4b6: new "Replace Octal Escape with Unicode Escape" intention ff1983d: IDEA-84569 Gradle - IntelliJ warning about 'main' in sourceSet 8f155fa: EfficientChooseByNameModel -> ChooseByNameModelEx EfficientChooseByNameContributor ->ChooseByNameContributorEx 7401dc6: two inner classes instead of anonymous ones for clarity 8076c8c: Merge remote-tracking branch 'origin/master' d7679bb: XmlElementStorage must pass any files to stream providers, project files too: step 1 — adapter for old StreamProvider interface (such old implementations will not get project files as before, only new new implementations). According to reviewer's suggestion, new interface is not part of platform-api, it is our impl interface 8d65d2e: don't expose getStartupPageField afaaeb4: StartBrowserPanel should not require usage SwingHelper.wrapWithHorizontalStretch, add clearBorder 53f4029: simplify saveForProviders 7c3e74c: Merge branch 'svn1_8_new' 24a4e13: Cleanup ExpressionUtils duplication 0bcf6a3: IDEA-112854 Save credentials to memory cache (for command line implementation) 851c574: IDEA-113555 void in right side of assignment de35189: EA-49916 diagnostics 5083a96: IDEA-113117 Groovy: NPE at GrIntroduceConstantDialog.initializeTargetClassEditor() on attempt to introduce a constant to an anonymous class 91f27f1: process only groovy files 5b636c4: IDEA-94942 Refactored utility cleanup command to use SvnLineCommand (instead of SvnSimpleCommand) 1f2c85e: fix testdata d92bbf1: IDEA-94942 Refactored info client to use SvnLineCommand (instead of SvnSimpleCommand) 780efca: allow to use framework-specific libraries from application servers installations 49312c3: IDEA-112821 IDEA falls in endless loop during editing run configurations f24a45e: Workaround for stringWidth in 7u40 03e8f77: IDEA-94942 Refactored update logic - use common behavior for command line svn commands fa37b7b: Platform: JavaDoc for ExecutionTargets +review CR-IC @yole a0c19e2: Platform: compare versions with different number of parts + Version class constructor's arguments order fixed 8b4064a: fix cat walking over keyboard 0fbc2ec: relax dfa time limit for global inspections c5fbb2e: dfa: fix wrong instanceof detection when using several incarnations of the same generic field with different substitutors 8049090: forget old splitter proportions, etc for the sake of less default values (IDEA-113644) 8c2cee3: unnecessary fqn: check for conflict parameterized references 4f24b07: IDEA-94942 Refactored commit logic - use common behavior for command line svn commands b38de05: IDEA-94942 Resolve repository url and command working directory based on command target (file or url) element (for each command line command) 2015083: java: highlighting for statics in anonymous classes 2c8eb0d: Cleanup (formatting) af9ffb8: fix SIOOBE dcfd5ea: Gradle: cosmetic change 6e3c972: platform: commit/dispose allocated model a7b887e: Gradle: changed settings of gradleHomeCache c6c74fa: Gradle: fix external project path option usage 0a138db: IDEA-94942 Refactored LineCommandListener - removed baseDirectory method 99eba34: restore "Fix StringBuilder append" quickfix a5d17029: Merge remote-tracking branch 'origin/master' 7a56ffa: dfa: cleanup block local variables when exiting it 852aaa1: more concise DfaVariableState.toString 0f1494e: dfa: don't multiply eq classes until really needed c2f28d8: VCS: improve ChangesTreeList selection in Tree mode 7cc9d99: Github: add util function a00623d: IDEA-113634 ("Confusing octal escape sequence" inspection misses some cases) e8d6955: before and after template text must be longer for IntentionDescriptionTest e16694e: IDEA-63698 (Inconvertible type (assign double to Integer) not highlighted as error) 0200bab: DfaMemoryState is unfortunately mutable; use defensive copying a808b08: "Replace Unicode Escape with Unescaped Character" intention (IDEA-60661) 11e73a4: allow to use element to the left if element to the right is not available (at the end of the file) ab2c4af: cleanup 91543ed: dfa: treat every getter-like invocation like a field access, don't look inside and don't parse other classes for that 3b8ee6f: global inspections: preallocate less memory for children 7afff0e: global inspections: store parameter references only once 368e989: revert: honor shouldBuildStubFor() for substituted languages 7436173: honor shouldBuildStubFor() for substituted languages 94c7d9b: separate template name for groovy e508172: EA-49855 - assert: TextRange.<init> select start offset for empty statement 353f4b8: EA-49924 - NPE: JavaMethodsConflictResolver.checkSameSignatures 7fa275b: spellchecker: dictionary extended f389b3f: use java LinkedHashMap (why order is not stable?) 7e13241: restore resolve() method with an old signature for old plugins support, mark it as deprecated 42141f3: IDEA-113538 Insert Managed Dependency: does not find artifact based on artifact id 93af907: Gradle: update bundled gradle version to '1.8-rc-1' 6a9eb29: Gradle: update bundled gradle version to '1.8-rc-1' 6bed505: Merge remote-tracking branch 'origin/master' 995ac2b: @InjectMocks also ignored (IDEA-113579) 4d869d9: IDEA-113532 Gradle: use gradle javadocs for script dsl 'quick documentation' enrichment 5769bd9: Merge remote-tracking branch 'origin/master' 9408a08: fix file case 09fbdf3: prefer java paste provider 88c43fb: new inference: fix dependencies b26f1f0: simplify API — TextBrowseFolderListener JSDebug settings editor — file chooser must use the same logic as RC producer 8429da0: Delete unused file with a lot of bugs. 1b6eba8: Update workaround for '--follow' log argument with largefiles extension. b8f0412: Merge remote-tracking branch 'origin/master' e0c2f16: IDEA-94942 Refactored AuthenticationCallback - accept repository url instead of file 269a0de: WEB-9250 Add "Start browser"/"with JavaScript debugger" options to Node.js run/debug configuration b78367f: Fix OC-8214: [',' on the next line] formatting option +review CR-OC @Anton.Makeev 2911086: minor optimization: do not wait for vfs refresh to complete in case build was cancelled cf9c4ae: remove unused import from test data 4c56a28: more assertions 614a73e: IDEA-94942 Require authentication callback for svn command be not null cb122ba: store language level in CoreLanguageLevelProjectExtension fa81fe4: Merge branch 'fix' of git://github.com/bashor/intellij-community into pull102 c51a79a: Fixed TypeConversionUtil#getAllBoxedTypeSupers (after f4a27e8). ProjectRootModificationTracker#getInstance returns NEVER_CHANGED when ProjectRootModificationTracker service not registered. 8c6247d: avoid empty commits, specify author based on system settings b358947: PropertiesComponentImpl must save settings in predictable stable order cf053bf: cleanup c5c0662: WebBrowsersConfiguration must save list of browsers in predictable stable order 1141959: ignore "ver" as well 63ccfea: cleanup f79f498: cleanup: unused code removed da234c7: cleanup: use less specific interface 33ca91f: unused code removed 3e598ed: IDEA-113519 Groovy Shell fails to open with exceptions 8cc385d: A minimal interface sufficient for XVariablesView usage extracted from XDebugSession. 0ab182e: drop obsolete bkwrd-compatibility 2dc69e5: cleanup e70fcab: not every field with non-annotated constructor initializer is notnull 6af48bb: dfa: fix & treatment 1af2b84: typos fbc3d18: IDEA-111450 false positive for "Redundant type cast" inspection b816d27: mission: new inference (initial) ff775ca: external annos: spare some findFileByUrl aea6b5b: IDEA-94942 Make "svn info <url>" work correctly - do not require File instance in parse logic 9304e4b: IDEA-94942 Make path to svn command line client be obtained only once 6e1d4ee: IDEA-98756 IDEA is unable to resolve AspectJ compiler JAR if Maven 3 importing is on 4262c63: ...create a file :) f6fc373: dfa: use more efficient references to common exception classes 9f6948f: IDEA-94942 Refactored commit logic - removed SvnBindClient ea61355: Do you want to create a file named xxx instead? 4e10a46: ExternalAnnotator: compatibility with older clients is restored; typo fixed in collectInformation name +review CR-IC-2315 cfd6567: IDEA-59783 Properties files: code completion list does not open after dot character e3335f6: ExternalAnnotator documentation is improved +review CR-IC-2315 89087c5: IDEA-113375 "Cyclic expand word" should expand words-separated-by-dashes too d10236b: revert "add possibility to setup lookup element for XML attribute values; IDEA-102167 layout_* attributes should go first" 7b2249b: Add ResolveContext object shared between all scheduled resolve tasks; IDEA-113446 Do not clear data in AndroidExternalApklibDependenciesManager. Instead, store cache in ResolveContext to avoid several resolves of one apklib artifact 7e1bcf2: support conversion of artifact settings d1cfd20: IntelliLang: error filter configuration fix & rename e4d31ad: IDEA-94942 Refactored method CommandUtil.putChangeLists (use concrete type instead of Object) 1c11e83: IDEA-113488 Show commit in git log from file history context menu 8415851: IDEA-94942 Changed log level from "warn" to "info" (in svn command execution logic) 24effbd: Merge branch 'master' of git://github.com/asedunov/intellij-community into pull101 c2ea835: 'prepare plugin for deployment' action creates separate jars for modules included into classpath of external build 88a2716: external annotator is allowed to decide if it should handle file with error +review CR-IC d2de078: IDEA-90511 Slow version comparison made faster. d9224ad: assertion fixed f2bf952: IDEA-113312 Do not fail svn command if could not determine working copy root to execute cleanup (after authentication failure) 315ec89: EA-49525 - assert: TextRange.<init> c052ec4: new project wizard: no checkboxes in header 22a8608: simplify JavaScriptDebugStarter — don't implement — consider to implement com.jetbrains.javascript.debugger.FileUrlMapper instead of providing mappings directly 9c8f60b: Merge remote-tracking branch 'origin/master' c6635f0: IDEA-112456 Show "Cleanup" link on "working copies information panel" for svn 1.8 working copies ace9afb: continue extract "Start Browser" functionality from J2EE to platform xml — JavaEEJavaScriptDebugStarter unified 3639fb1: extract "Start Browser" functionality from J2EE to platform xml, remove outdated BrowserLauncher IDEA-23782 tomcat run configuration: list all known browsers 97f8c64: remove deprecated method escapeUrl 59c7b63: IDEA-112794 Explicitly check that current logic could return "null" as svn command exit code 3af18cf: WEB-8397 Incorrect "element is not allowed here" inspection 840d7aa: cleanup 754959a: moved to psi b15f4f0: IDEA-113432 Groovy script classpath should include module dependencies d2030a5: provide default sensible implementation 4f6aadc: EA-49793 - NPE: FilePointerPartNode.update e87e071: customize GeneralHighlightingPass with - HighlightInfoProcessor which reacts to various highlight info lifecycle events - HighlightVisitorProducer which allows to change highlight visitor set to run in this pass (needed in DefaultHighlightVisitorBasedInspection) All this allows to get rid of MessageBus-propagated daemon events which turned out to be too expensive and to untangle GHP from UpdateHighlightingUtil. df5526b: moved to indexing 6581043: cleanup e68c984: moved to project-model 48c7973: suggest to create a file when user creates a directory named "foo.xt" (IDEA-113072) 85fd323: IDEA-112499 Static imports in live templates fail the second time they're used 95693da: WEB-9248 Emmet fails when having HTML entities 27c1f03: un-inject language 167b44d: un-inject language 22e526c: fix documentation prvovider 897e8ea6: resource roots: suggest only java roots for java-specific actions 64055b1: resource roots: show 'out of source' icon for java files under resource roots 5c9daf7: unused method removed 0f17e3d: file chooser: convert jar file from local FS to jar FS in all cases (IDEA-113159) 0b8e31f: <with> for changesViewContent 7349329: suppress warning for xmlRpcHandler 3dd899a: <with> for psi.referenceProvider, quoteHandler 4b0a964: revert 01d5b0e aa2399b: Merge branch 'svn1_8_new' 05ab0c6: DevKit: fix type name for plugin references f7c6cdb: DevKit: no do spellcheck <vendor> 5dc41cb: IDEA-94942 Implemented "Relocate" action 835d71e: java: utility method extracted 79f9b398: remove LoggerFactory.getInstance() because it can silently override static Log4j properties even when TestLoggerFactory is used e6cfd25: IDEA-112456 Implemented "Cleanup" action 2e9d443: Refresh $APP_ROOT/plugins manually on Grails application synchronization. +review CR-IU-291 7c2343c: Nullness cannot be null, therefore mark nullness as @NotNull 8d7f95a: IDEA-26350 (Bad Java code is green: variable might not have been initialized) 7ec8c9e: cleanup 0f63921: EA-49491 - NPE: RenameFileFix.isAvailable b0fb4e9: EA-49640 - IAE: ActionManagerImpl.getId a48e1e6: more diagnostics ed10a0e: more diagnostics c6190a8: cleanup de46935: IDEA-113147 Fixed "typo" so that url field contains url value (but not depth value) 7bf4b24: compact ui mode 842c947: IDEA-113180 Force '@' at the end of paths without peg revision passed to svn command line client ab23b28: don't generate java doc for synthetic elements 26ae6ba: Lense mode "internal" preview e1bb3a2: EA-48054 - CCE: MethodResolverProcessor.execute af608e8: EA-49203 - ISE: GrAnonymousClassType.getJavaClassName a62b14d: EA-48178 - IAE: GrLightClassReferenceElement.<init> b93e88c: EA-49152 - diagnostics ec324a7: Add synchronization on initialization of GroovyMethodInfo +review CR-IC @gromopert f98f472: AppCode: canceling simulator launch, if there are pending sessions to start b54680b: IDEA-94942 Refactored command line commit logic to use common way of parameters creation 8b0c612: remove GroovyDeclarationSearcher as it's only needed for dead Groovy++ (EA-49626) c608b03: dfa: use human numeration, not programmers' one 0c2794b: remove alphanumbering from Reopen Recent Project action 857fb3d: enable "scroll to the end" console action when the last line is not visible (IDEA-113322) 43a124a: correct implementation of ReverseCharSequence.subSequence 1337e5f: WEB-9232 Debugger: support inline base64-encoded source maps: nodejs support 4a0d7d9: AppServerSupportConfigurable reworked afe88ea: reworked IO exception dialog (IDEA-103128) 641595d: artifact editor: keep output file name and artifact name in sync even if output directory name was changed (IDEA-113412) 2a99cd3: IDEA-103015: Project Structure / module / Paths / output paths: Module action in disabled in file choosers ab8aa4e: EA-49739 added null checks in JDParser#formatJDTagDescription [CR-IC-2248] 668cf2c: IDEA-113465 Groovy: UOE at GrConcatenationAwareInjector.getLanguagesToInject() on adding @Language annotation to a string 9a8589c: EA-49261 - assert: PsiElementBase.notNullChild 5a99120: don't generate javadoc for light elements c8d30b0: EA-49487 - diagnostics ccf2ac3: Groovy introduce refactorings: show error hint 878ec43: EA-49641 - IAE: MissingReturnInspection.methodMissesSomeReturns 9574118: EA-47298 - IOE: PsiJavaParserFacadeImpl.createTypeElementFromText 4fceec4: use xml injections in Groovy 1775e6f: Fix maven test 9c4df88: IDEA-94942 Removed fake "empty" svn command 3c76855: IDEA-94942 Refactored status command not to use fake "empty" svn command e0556d8: IDEA-112811 Create client factory for merge based on target working copy format 1b27b17: IDEA-112811 Refactored merge options creation 243ba78: Allow inheritance from HierarchyBrowser implementations (Type/Method hierarchy) 91ef206: IDEA-112803 Implemented tree conflict resolution in "change details" panel 8abd924: IDEA-94942 Add ability to specify depth for "resolve conflict" command 967205e: IDEA-112803 Fixed committed data parsing for "svn status" command 12854d7: IDEA-94942 Update logic refactored to ClientFactory model 4a16e4b: IDEA-94942 Code cleanup - removed unused imports Change-Id: I6acefa9563b98b26db1f88e21354a0de20c27770
Diffstat (limited to 'build')
-rw-r--r--build/build.iml2
-rw-r--r--build/conf/nsis/DeleteSettings.ini26
-rw-r--r--build/conf/nsis/UninstallOldVersions.ini122
-rw-r--r--build/conf/nsis/desktop.ini26
-rw-r--r--build/conf/nsis/idea.nsi1057
-rw-r--r--build/conf/nsis/idea_en.nsi22
-rw-r--r--build/conf/nsis/idea_jp.nsi18
-rw-r--r--build/conf/nsis/paths.nsi6
-rw-r--r--build/conf/nsis/pathsCE.nsi5
-rw-r--r--build/conf/nsis/registry.nsi75
-rw-r--r--build/conf/nsis/strings.nsi13
-rw-r--r--build/conf/nsis/stringsCE.nsi13
-rw-r--r--build/conf/nsis/version.eap.nsi13
-rw-r--r--build/conf/nsis/version.nsi13
-rw-r--r--build/lib/NsiFiles.jarbin0 -> 4180 bytes
-rw-r--r--build/scripts/layouts.gant6
-rw-r--r--build/scripts/utils.gant64
-rw-r--r--build/src/com/intellij/internalUtilities/ant/NsiFiles.java198
18 files changed, 1679 insertions, 0 deletions
diff --git a/build/build.iml b/build/build.iml
index 4c0acee19caf..8c1854cb3e68 100644
--- a/build/build.iml
+++ b/build/build.iml
@@ -4,6 +4,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/scripts" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
@@ -29,6 +30,7 @@
</library>
</orderEntry>
<orderEntry type="module" module-name="antlayout" exported="" />
+ <orderEntry type="module" module-name="util" exported="" />
</component>
</module>
diff --git a/build/conf/nsis/DeleteSettings.ini b/build/conf/nsis/DeleteSettings.ini
new file mode 100644
index 000000000000..2c93ebfede7e
--- /dev/null
+++ b/build/conf/nsis/DeleteSettings.ini
@@ -0,0 +1,26 @@
+[Settings]
+NumFields=3
+
+[Field 1]
+Type=label
+Left=0
+Right=-1
+Top=0
+Bottom=40
+
+[Field 2]
+Type=checkbox
+Left=5
+Right=-1
+Top=40
+Bottom=50
+State=0
+
+[Field 3]
+Type=checkbox
+Left=5
+Right=-1
+Top=60
+Bottom=70
+State=0
+
diff --git a/build/conf/nsis/UninstallOldVersions.ini b/build/conf/nsis/UninstallOldVersions.ini
new file mode 100644
index 000000000000..583c19d699ec
--- /dev/null
+++ b/build/conf/nsis/UninstallOldVersions.ini
@@ -0,0 +1,122 @@
+[Settings]
+NumFields=12
+BackButtonText=Back
+;BackEnabled=0
+CancelButtonText=Cancel
+NextButtonText=Next
+
+[Field 1]
+Type=label
+Text=List of JB products
+Left=5
+Right=-1
+Top=0
+Bottom=15
+
+[Field 2]
+Type=RadioButton
+Text=regular uninstallation
+Left=5
+Right=120
+Top=27
+Bottom=37
+State=1
+
+[Field 3]
+Type=RadioButton
+Text=silent uninstallation
+Left=120
+Right=-1
+Top=27
+Bottom=37
+State=0
+
+[Field 4]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=47
+Bottom=57
+State=0
+
+[Field 5]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=59
+Bottom=69
+State=0
+
+[Field 6]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=71
+Bottom=81
+State=0
+
+[Field 7]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=83
+Bottom=93
+State=0
+
+[Field 8]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=95
+Bottom=105
+State=0
+
+[Field 9]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=107
+Bottom=117
+State=0
+
+[Field 10]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=119
+Bottom=129
+State=0
+
+[Field 11]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=131
+Bottom=141
+State=0
+
+[Field 12]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=143
+Bottom=153
+State=0
+
+[Field 13]
+Type=checkbox
+Text=An old installation
+Left=5
+Right=-1
+Top=155
+Bottom=165
+State=0
diff --git a/build/conf/nsis/desktop.ini b/build/conf/nsis/desktop.ini
new file mode 100644
index 000000000000..478a08152efe
--- /dev/null
+++ b/build/conf/nsis/desktop.ini
@@ -0,0 +1,26 @@
+[Settings]
+NumFields=3
+
+[Field 1]
+Type=checkbox
+Left=5
+Right=-1
+Top=10
+Bottom=20
+State=0
+
+[Field 2]
+Type=checkbox
+Left=5
+Right=-1
+Top=25
+Bottom=35
+State=1
+
+;[Field 3]
+;Type=checkbox
+;Left=5
+;Right=-1
+;Top=40
+;Bottom=50
+;State=1 \ No newline at end of file
diff --git a/build/conf/nsis/idea.nsi b/build/conf/nsis/idea.nsi
new file mode 100644
index 000000000000..3191b485dac2
--- /dev/null
+++ b/build/conf/nsis/idea.nsi
@@ -0,0 +1,1057 @@
+!verbose 2
+
+!include "paths.nsi"
+!include "strings.nsi"
+!include "Registry.nsi"
+!include "version.nsi"
+
+; Product with version (IntelliJ IDEA #xxxx).
+
+; Used in registry to put each build info into the separate subkey
+; Add&Remove programs doesn't understand subkeys in the Uninstall key,
+; thus ${PRODUCT_WITH_VER} is used for uninstall registry information
+!define PRODUCT_REG_VER "${MUI_PRODUCT}\${VER_BUILD}"
+
+Name "${MUI_PRODUCT}"
+SetCompressor lzma
+; http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
+RequestExecutionLevel user
+
+;------------------------------------------------------------------------------
+; include "Modern User Interface"
+;------------------------------------------------------------------------------
+!include "MUI2.nsh"
+!include "FileFunc.nsh"
+!include UAC.nsh
+!include "InstallOptions.nsh"
+!include StrFunc.nsh
+${UnStrStr}
+${UnStrLoc}
+${UnStrRep}
+${StrRep}
+
+ReserveFile "desktop.ini"
+ReserveFile "DeleteSettings.ini"
+ReserveFile '${NSISDIR}\Plugins\InstallOptions.dll'
+!insertmacro MUI_RESERVEFILE_LANGDLL
+
+!define MUI_ICON "${IMAGES_LOCATION}\${PRODUCT_ICON_FILE}"
+!define MUI_UNICON "${IMAGES_LOCATION}\${PRODUCT_UNINST_ICON_FILE}"
+
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_BITMAP "${IMAGES_LOCATION}\${PRODUCT_HEADER_FILE}"
+!define MUI_WELCOMEFINISHPAGE_BITMAP "${IMAGES_LOCATION}\${PRODUCT_LOGO_FILE}"
+
+;------------------------------------------------------------------------------
+; on GUI initialization installer checks whether IDEA is already installed
+;------------------------------------------------------------------------------
+
+!define MUI_CUSTOMFUNCTION_GUIINIT GUIInit
+
+Var baseRegKey
+Var IS_UPGRADE_60
+
+!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
+!define MUI_LANGDLL_REGISTRY_KEY "Software\JetBrains\${MUI_PRODUCT}\${VER_BUILD}\"
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+
+;check if the window is win7 or newer
+!macro INST_UNINST_SWITCH un
+ Function ${un}winVersion
+ ;The platform is returned into $0, minor version into $1.
+ ;Windows 7 is equals values of 6 as platform and 1 as minor version.
+ ;Windows 8 is equals values of 6 as platform and 2 as minor version.
+ nsisos::osversion
+ ${If} $0 == "6"
+ ${AndIf} $1 >= "1"
+ StrCpy $0 "1"
+ ${else}
+ StrCpy $0 "0"
+ ${EndIf}
+ FunctionEnd
+
+ Function ${un}compareFileInstallationTime
+ StrCpy $9 ""
+ get_first_file:
+ Pop $7
+ IfFileExists "$7" get_next_file 0
+ StrCmp $7 "Complete" complete get_first_file
+ get_next_file:
+ Pop $8
+ StrCmp $8 "Complete" 0 +2
+ ; check if there is only one property file
+ StrCmp $9 "no changes" complete different
+ IfFileExists "$8" 0 get_next_file
+ ClearErrors
+ ${GetTime} "$7" "M" $0 $1 $2 $3 $4 $5 $6
+ ${GetTime} "$8" "M" $R0 $R1 $R2 $R3 $R4 $R5 $R6
+ StrCmp $0 $R0 0 different
+ StrCmp $1 $R1 0 different
+ StrCmp $2 $R2 0 different
+ StrCmp $4 $R4 0 different
+ StrCmp $5 $R5 0 different
+ StrCmp $6 $R6 0 different
+ StrCpy $9 "no changes"
+ Goto get_next_file
+ different:
+ StrCpy $9 "Modified"
+ complete:
+FunctionEnd
+!macroend
+!insertmacro INST_UNINST_SWITCH ""
+!insertmacro INST_UNINST_SWITCH "un."
+
+Function InstDirState
+ !define InstDirState `!insertmacro InstDirStateCall`
+
+ !macro InstDirStateCall _PATH _RESULT
+ Push `${_PATH}`
+ Call InstDirState
+ Pop ${_RESULT}
+ !macroend
+
+ Exch $0
+ Push $1
+ ClearErrors
+
+ FindFirst $1 $0 '$0\*.*'
+ IfErrors 0 +3
+ StrCpy $0 -1
+ goto end
+ StrCmp $0 '.' 0 +4
+ FindNext $1 $0
+ StrCmp $0 '..' 0 +2
+ FindNext $1 $0
+ FindClose $1
+ IfErrors 0 +3
+ StrCpy $0 0
+ goto end
+ StrCpy $0 1
+
+ end:
+ Pop $1
+ Exch $0
+FunctionEnd
+
+Function SplitFirstStrPart
+ Exch $R0
+ Exch
+ Exch $R1
+ Push $R2
+ Push $R3
+ StrCpy $R3 $R1
+ StrLen $R1 $R0
+ IntOp $R1 $R1 + 1
+ loop:
+ IntOp $R1 $R1 - 1
+ StrCpy $R2 $R0 1 -$R1
+ StrCmp $R1 0 exit0
+ StrCmp $R2 $R3 exit1 loop
+ exit0:
+ StrCpy $R1 ""
+ Goto exit2
+ exit1:
+ IntOp $R1 $R1 - 1
+ StrCmp $R1 0 0 +3
+ StrCpy $R2 ""
+ Goto +2
+ StrCpy $R2 $R0 "" -$R1
+ IntOp $R1 $R1 + 1
+ StrCpy $R0 $R0 -$R1
+ StrCpy $R1 $R2
+ exit2:
+ Pop $R3
+ Pop $R2
+ Exch $R1 ;rest
+ Exch
+ Exch $R0 ;first
+FunctionEnd
+
+Function VersionSplit
+ !define VersionSplit `!insertmacro VersionSplitCall`
+
+ !macro VersionSplitCall _FULL _PRODUCT _BRANCH _BUILD
+ Push `${_FULL}`
+ Call VersionSplit
+ Pop ${_PRODUCT}
+ Pop ${_BRANCH}
+ Pop ${_BUILD}
+ !macroend
+
+ Pop $R0
+ Push "-"
+ Push $R0
+ Call SplitFirstStrPart
+ Pop $R0
+ Pop $R1
+ Push "."
+ Push $R1
+ Call SplitFirstStrPart
+ Push $R0
+FunctionEnd
+
+Function OnDirectoryPageLeave
+ StrCpy $IS_UPGRADE_60 "0"
+ ${InstDirState} "$INSTDIR" $R0
+ IntCmp $R0 1 check_build skip_abort skip_abort
+check_build:
+ FileOpen $R1 "$INSTDIR\build.txt" "r"
+ IfErrors do_abort
+ FileRead $R1 $R2
+ FileClose $R1
+ IfErrors do_abort
+ ${VersionSplit} ${MIN_UPGRADE_BUILD} $R3 $R4 $R5
+ ${VersionSplit} ${MAX_UPGRADE_BUILD} $R6 $R7 $R8
+ ${VersionSplit} $R2 $R9 $R2 $R0
+ StrCmp $R9 $R3 0 do_abort
+ IntCmp $R2 $R4 0 do_abort
+ IntCmp $R0 $R5 do_accept do_abort
+
+ StrCmp $R9 $R6 0 do_abort
+ IntCmp $R2 $R7 0 0 do_abort
+ IntCmp $R0 $R8 do_abort do_accept do_abort
+
+do_accept:
+ StrCpy $IS_UPGRADE_60 "1"
+ FileClose $R1
+ Goto skip_abort
+
+do_abort:
+ ;check
+ ; - if there are no files into $INSTDIR (recursively) just excepted property files
+ ; - if property files have the same installation time.
+ StrCpy $9 "$INSTDIR"
+ Call instDirEmpty
+ StrCmp $9 "not empty" abort 0
+ Push "Complete"
+ Push "$INSTDIR\bin\${PRODUCT_EXE_FILE}.vmoptions"
+ Push "$INSTDIR\bin\idea.properties"
+ ${StrRep} $0 ${PRODUCT_EXE_FILE} ".exe" "64.exe.vmoptions"
+ Push "$INSTDIR\bin\$0"
+ Call compareFileInstallationTime
+ StrCmp $9 "Modified" abort skip_abort
+abort:
+ MessageBox MB_OK|MB_ICONEXCLAMATION "$(empty_or_upgrade_folder)"
+ Abort
+skip_abort:
+FunctionEnd
+
+
+;check if there are no files into $INSTDIR recursively just except property files.
+Function instDirEmpty
+ Push $0
+ Push $1
+ Push $2
+ ClearErrors
+ FindFirst $1 $2 "$9\*.*"
+nextElemement:
+ ;is the element a folder?
+ StrCmp $2 "." getNextElement
+ StrCmp $2 ".." getNextElement
+ IfFileExists "$9\$2\*.*" 0 nextFile
+ Push $9
+ StrCpy "$9" "$9\$2"
+ Call instDirEmpty
+ StrCmp $9 "not empty" done 0
+ Pop $9
+ Goto getNextElement
+nextFile:
+ ;is it the file property?
+ ${If} $2 != "idea.properties"
+ ${AndIf} $2 != "${PRODUCT_EXE_FILE}.vmoptions"
+ ${StrRep} $0 ${PRODUCT_EXE_FILE} ".exe" "64.exe.vmoptions"
+ ${AndIf} $2 != $0
+ StrCpy $9 "not empty"
+ Goto done
+ ${EndIf}
+getNextElement:
+ FindNext $1 $2
+ IfErrors 0 nextElemement
+done:
+ FindClose $1
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+
+;------------------------------------------------------------------------------
+; Variables
+;------------------------------------------------------------------------------
+ Var STARTMENU_FOLDER
+ Var config_path
+ Var system_path
+
+;------------------------------------------------------------------------------
+; configuration
+;------------------------------------------------------------------------------
+
+!insertmacro MUI_PAGE_WELCOME
+
+Page custom uninstallOldVersionDialog
+Var control_fields
+Var max_fields
+
+!ifdef LICENSE_FILE
+!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)"
+!endif
+
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE OnDirectoryPageLeave
+!insertmacro MUI_PAGE_DIRECTORY
+
+Page custom ConfirmDesktopShortcut
+ !define MUI_STARTMENUPAGE_NODISABLE
+ !define MUI_STARTMENUPAGE_DEFAULTFOLDER "JetBrains"
+
+!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
+!define MUI_ABORTWARNING
+!insertmacro MUI_PAGE_INSTFILES
+!define MUI_FINISHPAGE_RUN_NOTCHECKED
+!define MUI_FINISHPAGE_RUN
+!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
+!insertmacro MUI_PAGE_FINISH
+
+!define MUI_UNINSTALLER
+!insertmacro MUI_UNPAGE_CONFIRM
+UninstPage custom un.ConfirmDeleteSettings
+!insertmacro MUI_UNPAGE_INSTFILES
+
+OutFile "${OUT_DIR}\${OUT_FILE}.exe"
+
+InstallDir "$PROGRAMFILES\${MANUFACTURER}\${PRODUCT_WITH_VER}"
+!define MUI_BRANDINGTEXT " "
+BrandingText " "
+
+Function PageFinishRun
+!insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\bin\${PRODUCT_EXE_FILE}" "" "" ""
+FunctionEnd
+
+;------------------------------------------------------------------------------
+; languages
+;------------------------------------------------------------------------------
+!insertmacro MUI_LANGUAGE "English"
+;!insertmacro MUI_LANGUAGE "Japanese"
+!include "idea_en.nsi"
+;!include "idea_jp.nsi"
+
+!ifdef LICENSE_FILE
+LicenseLangString myLicenseData ${LANG_ENGLISH} "${LICENSE_FILE}.txt"
+LicenseLangString myLicenseData ${LANG_JAPANESE} "${LICENSE_FILE}.txt"
+!endif
+
+Function .onInit
+ StrCpy $baseRegKey "HKCU"
+ IfSilent UAC_Done
+UAC_Elevate:
+ !insertmacro UAC_RunElevated
+ StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user? - continue install under user
+ StrCmp 0 $0 0 UAC_Err ; Error?
+ StrCmp 1 $1 0 UAC_Success ;Are we the real deal or just the wrapper?
+ Quit
+UAC_Err:
+ Abort
+UAC_ElevationAborted:
+ StrCpy $INSTDIR "$APPDATA\${MANUFACTURER}\${PRODUCT_WITH_VER}"
+ goto UAC_Done
+UAC_Success:
+ StrCmp 1 $3 UAC_Admin ;Admin?
+ StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
+ goto UAC_Elevate
+UAC_Admin:
+ StrCpy $INSTDIR "$PROGRAMFILES\${MANUFACTURER}\${PRODUCT_WITH_VER}"
+ SetShellVarContext all
+ StrCpy $baseRegKey "HKLM"
+UAC_Done:
+; !insertmacro MUI_LANGDLL_DISPLAY
+FunctionEnd
+
+Function checkVersion
+ StrCpy $2 ""
+ StrCpy $1 "Software\${MANUFACTURER}\${PRODUCT_REG_VER}"
+; ${If} $0 == "HKLM"
+; StrCpy $1 "Software\${MANUFACTURER}\${PRODUCT_REG_VER}"
+; Push $0
+; call winVersion
+; ${If} $0 == "1"
+; StrCpy $1 "Software\Wow6432Node\${MANUFACTURER}\${PRODUCT_REG_VER}"
+; ${Else}
+; StrCpy $1 "Software\${MANUFACTURER}\${PRODUCT_REG_VER}"
+; ${EndIf}
+; Pop $0
+; ${EndIf}
+ Call OMReadRegStr
+ IfFileExists $3\bin\${PRODUCT_EXE_FILE} check_version
+ Goto Done
+check_version:
+ StrCpy $2 "Build"
+ Call OMReadRegStr
+ StrCmp $3 "" Done
+ IntCmpU $3 ${VER_BUILD} ask_Install_Over Done ask_Install_Over
+ask_Install_Over:
+ MessageBox MB_YESNO|MB_ICONQUESTION "$(current_version_already_installed)" IDYES continue IDNO exit_installer
+exit_installer:
+ Abort
+continue:
+ StrCpy $0 "complete"
+Done:
+FunctionEnd
+
+
+Function searchCurrentVersion
+ ; search current version of IDEA
+ StrCpy $0 "HKCU"
+ Call checkVersion
+ StrCmp $0 "complete" Done
+ StrCpy $0 "HKLM"
+ Call checkVersion
+Done:
+FunctionEnd
+
+
+Function uninstallOldVersion
+ ;check if the uninstalled application is running
+remove_previous_installation:
+ ;prepare a copy of launcher
+ CopyFiles "$3\bin\${PRODUCT_EXE_FILE}" "$3\bin\${PRODUCT_EXE_FILE}_copy"
+ ClearErrors
+ ;copy launcher to itself
+ CopyFiles "$3\bin\${PRODUCT_EXE_FILE}_copy" "$3\bin\${PRODUCT_EXE_FILE}"
+ Delete "$3\bin\${PRODUCT_EXE_FILE}_copy"
+ IfErrors 0 +3
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION|MB_TOPMOST "$(application_running)" IDYES remove_previous_installation IDNO complete
+ goto complete
+ !insertmacro INSTALLOPTIONS_READ $9 "UninstallOldVersions.ini" "Field 2" "State"
+ ${If} $9 == "1"
+ ExecWait '"$3\bin\Uninstall.exe" _?=$3\bin'
+ ${else}
+ ExecWait '"$3\bin\Uninstall.exe" /S'
+ ${EndIf}
+ IfFileExists $3\bin\${PRODUCT_EXE_FILE} 0 uninstall
+ goto complete
+uninstall:
+ ;previous installation has been removed
+ ;customer decided to keep properties?
+ IfFileExists $3\bin\idea.properties saveProperties fullRemove
+saveProperties:
+ Delete "$3\bin\Uninstall.exe"
+ Goto complete
+fullRemove:
+ RmDir /r "$3"
+complete:
+FunctionEnd
+
+
+Function checkProductVersion
+;$8 - count of already added fields to the dialog
+;$3 - an old version which will be checked if the one should be added too
+StrCpy $7 $control_fields
+StrCpy $6 ""
+loop:
+ IntOp $7 $7 + 1
+ ${If} $8 >= $7
+ !insertmacro INSTALLOPTIONS_READ $6 "UninstallOldVersions.ini" "Field $7" "Text"
+ ${If} $6 == $3
+ ;found the same value in list of installations
+ StrCpy $6 "duplicated"
+ Goto finish
+ ${EndIf}
+ Goto loop
+ ${EndIf}
+finish:
+FunctionEnd
+
+
+Function uninstallOldVersionDialog
+ StrCpy $control_fields 3
+ StrCpy $max_fields 11
+ StrCpy $0 "HKLM"
+ StrCpy $4 0
+ ReserveFile "UninstallOldVersions.ini"
+ !insertmacro INSTALLOPTIONS_EXTRACT "UninstallOldVersions.ini"
+ !insertmacro MUI_HEADER_TEXT "$(uninstall_previous_installations_title)" "$(uninstall_previous_installations)"
+ !insertmacro INSTALLOPTIONS_WRITE "UninstallOldVersions.ini" "Field 1" "Text" "$(uninstall_previous_installations_prompt)"
+ StrCpy $8 $control_fields
+
+get_installation_info:
+ StrCpy $1 "Software\${MANUFACTURER}\${MUI_PRODUCT}"
+ StrCpy $5 "\bin\${PRODUCT_EXE_FILE}"
+ StrCpy $2 ""
+ Call getInstallationPath
+ StrCmp $3 "complete" next_registry_root
+ ;check if the old installation could be uninstalled
+ IfFileExists $3\bin\Uninstall.exe uninstall_dialog get_next_key
+uninstall_dialog:
+ Call checkProductVersion
+ ${If} $6 != "duplicated"
+ IntOp $8 $8 + 1
+ !insertmacro INSTALLOPTIONS_WRITE "UninstallOldVersions.ini" "Field $8" "Text" "$3"
+ StrCmp $8 $max_fields complete
+ ${EndIf}
+get_next_key:
+ IntOp $4 $4 + 1 ;to check next record from registry
+ goto get_installation_info
+
+next_registry_root:
+${If} $0 == "HKLM"
+ StrCpy $0 "HKCU"
+ StrCpy $4 0
+ Goto get_installation_info
+${EndIf}
+complete:
+!insertmacro INSTALLOPTIONS_WRITE "UninstallOldVersions.ini" "Settings" "NumFields" "$8"
+${If} $8 > $control_fields
+ !insertmacro INSTALLOPTIONS_DISPLAY "UninstallOldVersions.ini"
+ ;uninstall chosen installation(s)
+loop:
+ !insertmacro INSTALLOPTIONS_READ $0 "UninstallOldVersions.ini" "Field $8" "State"
+ !insertmacro INSTALLOPTIONS_READ $3 "UninstallOldVersions.ini" "Field $8" "Text"
+ ${If} $0 == "1"
+ Call uninstallOldVersion
+ ${EndIf}
+ IntOp $8 $8 - 1
+ StrCmp $8 $control_fields finish loop
+ ${EndIf}
+finish:
+FunctionEnd
+
+
+Function getInstallationPath
+ Push $1
+ Push $2
+ Push $5
+loop:
+ Call OMEnumRegKey
+ StrCmp $3 "" 0 getPath
+ StrCpy $3 "complete"
+ goto done
+getPath:
+ Push $1
+ StrCpy $1 "$1\$3"
+ Call OMReadRegStr
+ Pop $1
+ IfFileExists $3$5 done 0
+ IntOp $4 $4 + 1
+ goto loop
+done:
+ Pop $5
+ Pop $2
+ Pop $1
+FunctionEnd
+
+
+Function GUIInit
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+
+; is the current version of IDEA installed?
+ Call searchCurrentVersion
+
+; search old versions of IDEA
+ StrCpy $4 0
+ StrCpy $0 "HKCU"
+ StrCpy $1 "Software\${MANUFACTURER}\${MUI_PRODUCT}"
+ StrCpy $5 "\bin\${PRODUCT_EXE_FILE}"
+ StrCpy $2 ""
+ Call getInstallationPath
+ StrCmp $3 "complete" all_users
+ IfFileExists $3\bin\${PRODUCT_EXE_FILE} old_version_located all_users
+all_users:
+ StrCpy $4 0
+ StrCpy $0 "HKLM"
+ Call getInstallationPath
+ StrCmp $3 "complete" success
+ IfFileExists $3\bin\${PRODUCT_EXE_FILE} 0 success
+old_version_located:
+; MessageBox MB_YESNO|MB_ICONQUESTION "$(previous_installations)" IDYES uninstall IDNO success
+;uninstall:
+; Call uninstallOldVersions
+
+success:
+ IntCmp ${SHOULD_SET_DEFAULT_INSTDIR} 0 end_enum_versions_hklm
+ StrCpy $3 "0" # latest build number
+ StrCpy $0 "0" # registry key index
+
+enum_versions_hkcu:
+ EnumRegKey $1 "HKCU" "Software\${MANUFACTURER}\${MUI_PRODUCT}" $0
+ StrCmp $1 "" end_enum_versions_hkcu
+ IntCmp $1 $3 continue_enum_versions_hkcu continue_enum_versions_hkcu
+ StrCpy $3 $1
+ ReadRegStr $INSTDIR "HKCU" "Software\${MANUFACTURER}\${MUI_PRODUCT}\$3" ""
+
+continue_enum_versions_hkcu:
+ IntOp $0 $0 + 1
+ Goto enum_versions_hkcu
+
+end_enum_versions_hkcu:
+
+ StrCpy $0 "0" # registry key index
+
+enum_versions_hklm:
+ EnumRegKey $1 "HKLM" "Software\${MANUFACTURER}\${MUI_PRODUCT}" $0
+ StrCmp $1 "" end_enum_versions_hklm
+ IntCmp $1 $3 continue_enum_versions_hklm continue_enum_versions_hklm
+ StrCpy $3 $1
+ ReadRegStr $INSTDIR "HKLM" "Software\${MANUFACTURER}\${MUI_PRODUCT}\$3" ""
+
+continue_enum_versions_hklm:
+ IntOp $0 $0 + 1
+ Goto enum_versions_hklm
+
+end_enum_versions_hklm:
+
+ StrCmp $INSTDIR "" 0 skip_default_instdir
+ StrCpy $INSTDIR "$PROGRAMFILES\${MANUFACTURER}\${MUI_PRODUCT} ${MUI_VERSION_MAJOR}.${MUI_VERSION_MINOR}"
+skip_default_instdir:
+
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ !insertmacro INSTALLOPTIONS_EXTRACT "Desktop.ini"
+
+FunctionEnd
+
+
+;------------------------------------------------------------------------------
+; Installer sections
+;------------------------------------------------------------------------------
+Section "IDEA Files" CopyIdeaFiles
+; StrCpy $baseRegKey "HKCU"
+; !insertmacro INSTALLOPTIONS_READ $R2 "Desktop.ini" "Field 3" "State"
+; StrCmp $R2 1 continue_for_current_user
+; SetShellVarContext all
+; StrCpy $baseRegKey "HKLM"
+; continue_for_current_user:
+
+; create shortcuts
+
+ !insertmacro INSTALLOPTIONS_READ $R2 "Desktop.ini" "Field 1" "State"
+ StrCmp $R2 1 "" skip_desktop_shortcut
+ CreateShortCut "$DESKTOP\${PRODUCT_FULL_NAME_WITH_VER}.lnk" \
+ "$INSTDIR\bin\${PRODUCT_EXE_FILE}" "" "" "" SW_SHOWNORMAL
+
+skip_desktop_shortcut:
+ ; OS is not win7
+ Call winVersion
+ ${If} $0 == "0"
+ !insertmacro INSTALLOPTIONS_READ $R2 "Desktop.ini" "Field 2" "State"
+ StrCmp $R2 1 "" skip_quicklaunch_shortcut
+ CreateShortCut "$QUICKLAUNCH\${PRODUCT_FULL_NAME_WITH_VER}.lnk" \
+ "$INSTDIR\bin\${PRODUCT_EXE_FILE}" "" "" "" SW_SHOWNORMAL
+ ${EndIf}
+skip_quicklaunch_shortcut:
+
+!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+; $STARTMENU_FOLDER stores name of IDEA folder in Start Menu,
+; save it name in the "MenuFolder" RegValue
+ CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
+
+ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\${PRODUCT_FULL_NAME_WITH_VER}.lnk" \
+ "$INSTDIR\bin\${PRODUCT_EXE_FILE}" "" "" "" SW_SHOWNORMAL
+; CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall ${PRODUCT_FULL_NAME_WITH_VER}.lnk" \
+; "$INSTDIR\bin\Uninstall.exe"
+ StrCpy $0 $baseRegKey
+ StrCpy $1 "Software\${MANUFACTURER}\${PRODUCT_REG_VER}"
+ StrCpy $2 "MenuFolder"
+ StrCpy $3 "$STARTMENU_FOLDER"
+ Call OMWriteRegStr
+!insertmacro MUI_STARTMENU_WRITE_END
+
+ StrCmp ${IPR} "false" skip_ipr
+
+ ; back up old value of .ipr
+!define Index "Line${__LINE__}"
+ ReadRegStr $1 HKCR ".ipr" ""
+ StrCmp $1 "" "${Index}-NoBackup"
+ StrCmp $1 "IntelliJIdeaProjectFile" "${Index}-NoBackup"
+ WriteRegStr HKCR ".ipr" "backup_val" $1
+"${Index}-NoBackup:"
+ WriteRegStr HKCR ".ipr" "" "IntelliJIdeaProjectFile"
+ ReadRegStr $0 HKCR "IntelliJIdeaProjectFile" ""
+ StrCmp $0 "" 0 "${Index}-Skip"
+ WriteRegStr HKCR "IntelliJIdeaProjectFile" "" "IntelliJ IDEA Project File"
+ WriteRegStr HKCR "IntelliJIdeaProjectFile\shell" "" "open"
+ WriteRegStr HKCR "IntelliJIdeaProjectFile\DefaultIcon" "" "$INSTDIR\bin\idea.exe,0"
+"${Index}-Skip:"
+ WriteRegStr HKCR "IntelliJIdeaProjectFile\shell\open\command" "" \
+ '$INSTDIR\bin\${PRODUCT_EXE_FILE} "%1"'
+
+ ; back up old value of .java
+ StrCmp "${PRODUCT_FULL_NAME}" "IntelliJ IDEA Community Edition" java_association
+ StrCmp "${PRODUCT_FULL_NAME}" "IntelliJ IDEA" 0 skip_ipr
+java_association:
+ ReadRegStr $1 HKCR ".java" ""
+ StrCmp $1 "" skip_backup
+ StrCmp $1 "IntelliJIdeaProjectFile" skip_backup
+ WriteRegStr HKCR ".java" "backup_val" $1
+skip_backup:
+ WriteRegStr HKCR ".java" "" "IntelliJIdeaProjectFile"
+!undef Index
+
+skip_ipr:
+
+ ; Rest of script
+
+
+; readonly section
+ SectionIn RO
+!include "idea_win.nsh"
+
+ IntCmp $IS_UPGRADE_60 1 skip_properties
+ SetOutPath $INSTDIR\bin
+ File "${PRODUCT_PROPERTIES_FILE}"
+ File "${PRODUCT_VM_OPTIONS_FILE}"
+skip_properties:
+
+ StrCpy $0 $baseRegKey
+ StrCpy $1 "Software\${MANUFACTURER}\${PRODUCT_REG_VER}"
+ StrCpy $2 ""
+ StrCpy $3 "$INSTDIR"
+ Call OMWriteRegStr
+ StrCpy $2 "Build"
+ StrCpy $3 ${VER_BUILD}
+ Call OMWriteRegStr
+
+; write uninstaller & add it to add/remove programs in control panel
+ WriteUninstaller "$INSTDIR\bin\Uninstall.exe"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "DisplayName" "${PRODUCT_FULL_NAME_WITH_VER}"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "UninstallString" "$INSTDIR\bin\Uninstall.exe"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "InstallLocation" "$INSTDIR"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "DisplayIcon" "$INSTDIR\bin\${PRODUCT_EXE_FILE}"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "DisplayVersion" "${VER_BUILD}"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "Publisher" "JetBrains s.r.o."
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "URLInfoAbout" "http://www.jetbrains.com/products"
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "InstallType" "$baseRegKey"
+ WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "NoModify" 1
+ WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" \
+ "NoRepair" 1
+
+ ExecWait "$INSTDIR\jre\jre\bin\javaw.exe -Xshare:dump"
+ SetOutPath $INSTDIR\bin
+ ; set the current time for installation files under $INSTDIR\bin
+ ExecCmd::exec 'copy "$INSTDIR\bin\*.*s" +,,'
+ call winVersion
+ ${If} $0 == "1"
+ ;ExecCmd::exec 'icacls "$INSTDIR" /grant %username%:F /T >"$INSTDIR"\installation_log.txt 2>"$INSTDIR"\installation_error.txt'
+ AccessControl::GrantOnFile \
+ "$INSTDIR" "(S-1-5-32-545)" "GenericRead + GenericExecute + GenericWrite + Delete"
+ ${EndIf}
+SectionEnd
+
+;------------------------------------------------------------------------------
+; Descriptions of sections
+;------------------------------------------------------------------------------
+; LangString DESC_CopyRuntime ${LANG_ENGLISH} "${MUI_PRODUCT} files"
+
+;------------------------------------------------------------------------------
+; custom install pages
+;------------------------------------------------------------------------------
+
+Function ConfirmDesktopShortcut
+ !insertmacro MUI_HEADER_TEXT "$(installation_options)" "$(installation_options_prompt)"
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 1" "Text" "$(create_desktop_shortcut)"
+ call winVersion
+ ${If} $0 == "1"
+ ;do not ask user about creating quick launch under Windows 7
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Settings" "NumFields" "1"
+ ${Else}
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 2" "Text" "$(create_quick_launch_shortcut)"
+ ${EndIf}
+; !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 3" "Text" "$(install_for_current_user_only)"
+ !insertmacro INSTALLOPTIONS_DISPLAY "Desktop.ini"
+FunctionEnd
+
+
+;------------------------------------------------------------------------------
+; custom uninstall functions
+;------------------------------------------------------------------------------
+
+Function un.onInit
+ !insertmacro MUI_UNGETLANGUAGE
+ !insertmacro INSTALLOPTIONS_EXTRACT "DeleteSettings.ini"
+FunctionEnd
+
+Function OMEnumRegKey
+ StrCmp $0 "HKCU" hkcu
+ EnumRegKey $3 HKLM $1 $4
+ goto done
+hkcu:
+ EnumRegKey $3 HKCU $1 $4
+done:
+FunctionEnd
+
+Function un.OMReadRegStr
+ StrCmp $0 "HKCU" hkcu
+ ReadRegStr $3 HKLM $1 $2
+ goto done
+hkcu:
+ ReadRegStr $3 HKCU $1 $2
+done:
+FunctionEnd
+
+Function un.OMDeleteRegValue
+ StrCmp $0 "HKCU" hkcu
+ DeleteRegValue HKLM $1 $2
+ goto done
+hkcu:
+ DeleteRegValue HKCU $1 $2
+done:
+FunctionEnd
+
+Function un.ReturnBackupRegValue
+ ;replace Default str with the backup value (if there is the one) and then delete backup
+ ; $1 - key (for example ".java")
+ ; $2 - name (for example "backup_val")
+ ReadRegStr $0 HKCR $1 $2
+ StrCmp $0 "" "noBackup"
+ WriteRegStr HKCR $1 "" $0
+ DeleteRegValue HKCR $1 $2
+noBackup:
+FunctionEnd
+
+Function un.OMDeleteRegKeyIfEmpty
+ StrCmp $0 "HKCU" hkcu
+ DeleteRegKey /ifempty HKLM $1
+ goto done
+hkcu:
+ DeleteRegKey /ifempty HKCU $1
+done:
+FunctionEnd
+
+Function un.OMDeleteRegKey
+ StrCmp $0 "HKCU" hkcu
+ DeleteRegKey /ifempty HKLM $1
+ goto done
+hkcu:
+ DeleteRegKey /ifempty HKCU $1
+done:
+FunctionEnd
+
+Function un.OMWriteRegStr
+ StrCmp $0 "HKCU" hkcu
+ WriteRegStr HKLM $1 $2 $3
+ goto done
+hkcu:
+ WriteRegStr HKCU $1 $2 $3
+done:
+FunctionEnd
+
+
+;------------------------------------------------------------------------------
+; custom uninstall pages
+;------------------------------------------------------------------------------
+
+Function un.ConfirmDeleteSettings
+ !insertmacro MUI_HEADER_TEXT "$(uninstall_options)" "$(uninstall_options_prompt)"
+ !insertmacro INSTALLOPTIONS_WRITE "DeleteSettings.ini" "Field 1" "Text" "$(prompt_delete_settings)"
+ !insertmacro INSTALLOPTIONS_WRITE "DeleteSettings.ini" "Field 2" "Text" "$(confirm_delete_caches)"
+ !insertmacro INSTALLOPTIONS_WRITE "DeleteSettings.ini" "Field 3" "Text" "$(confirm_delete_settings)"
+ !insertmacro INSTALLOPTIONS_DISPLAY "DeleteSettings.ini"
+FunctionEnd
+
+
+Function un.PrepareCustomPath
+ ;Input:
+ ;$0 - name of variable
+ ;$1 - value of the variable
+ ;$2 - line from the property file
+ push $3
+ push $5
+ ${UnStrLoc} $3 $2 $0 ">"
+ StrCmp $3 "" not_found
+ StrLen $5 $0
+ IntOp $3 $3 + $5
+ StrCpy $2 $2 "" $3
+ IfFileExists "$1$2\\*.*" not_found
+ StrCpy $2 $1$2
+ goto complete
+not_found:
+ StrCpy $0 ""
+complete:
+ pop $5
+ pop $3
+FunctionEnd
+
+
+Function un.getCustomPath
+ push $0
+ push $1
+ StrCpy $0 "${user.home}/"
+ StrCpy $1 "$PROFILE/"
+ Call un.PrepareCustomPath
+ StrCmp $0 "" check_idea_var
+ goto complete
+check_idea_var:
+ StrCpy $0 "${idea.home}/"
+ StrCpy $1 "$INSTDIR/"
+ Call un.PrepareCustomPath
+ StrCmp $2 "" +1 +2
+ StrCpy $2 ""
+complete:
+ pop $1
+ pop $0
+FunctionEnd
+
+
+Function un.getPath
+; The function read lines from idea.properties and search the substring and prepare the path to settings or caches.
+ ClearErrors
+ FileOpen $3 $INSTDIR\bin\idea.properties r
+ IfErrors complete ;file can not be open. not sure if a message should be displayed in this case.
+ StrLen $5 $1
+read_line:
+ FileRead $3 $4
+ StrCmp $4 "" complete
+ ${UnStrLoc} $6 $4 $1 ">"
+ StrCmp $6 "" read_line ; there is no substring in a string from the file. go for next one.
+ IntOp $6 $6 + $5
+ ${unStrStr} $7 $4 "#" ;check if the property has been customized
+ StrCmp $7 "" custom
+ StrCpy $2 "$PROFILE/${PRODUCT_SETTINGS_DIR}/$0" ;no. use the default value.
+ goto complete
+custom:
+ StrCpy $2 $4 "" $6
+ Call un.getCustomPath
+complete:
+ FileClose $3
+ ${UnStrRep} $2 $2 "/" "\"
+FunctionEnd
+
+
+Section "Uninstall"
+ StrCpy $baseRegKey "HKCU"
+ ; Uninstaller is in the \bin directory, we need upper level dir
+ StrCpy $INSTDIR $INSTDIR\..
+
+ !insertmacro INSTALLOPTIONS_READ $R2 "DeleteSettings.ini" "Field 2" "State"
+ DetailPrint "Data: $DOCUMENTS\..\${PRODUCT_SETTINGS_DIR}\"
+ StrCmp $R2 1 "" skip_delete_caches
+ ;find the path to caches (system) folder
+ StrCpy $0 "system"
+ StrCpy $1 "idea.system.path="
+ Call un.getPath
+ StrCmp $2 "" skip_delete_caches
+ StrCpy $system_path $2
+ RmDir /r "$system_path"
+ RmDir "$system_path\\.." ; remove parent of system dir if the dir is empty
+; RmDir /r $DOCUMENTS\..\${PRODUCT_SETTINGS_DIR}\system
+skip_delete_caches:
+
+ !insertmacro INSTALLOPTIONS_READ $R3 "DeleteSettings.ini" "Field 3" "State"
+ StrCmp $R3 1 "" skip_delete_settings
+ ;find the path to settings (config) folder
+ StrCpy $0 "config"
+ StrCpy $1 "idea.config.path="
+ Call un.getPath
+ StrCmp $2 "" skip_delete_settings
+ StrCpy $config_path $2
+ RmDir /r "$config_path"
+; RmDir /r $DOCUMENTS\..\${PRODUCT_SETTINGS_DIR}\config
+ Delete "$INSTDIR\bin\${PRODUCT_VM_OPTIONS_NAME}"
+ Delete "$INSTDIR\bin\idea.properties"
+ StrCmp $R2 1 "" skip_delete_settings
+ RmDir "$config_path\\.." ; remove parent of config dir if the dir is empty
+; RmDir $DOCUMENTS\..\${PRODUCT_SETTINGS_DIR}
+skip_delete_settings:
+
+; Delete uninstaller itself
+ Delete "$INSTDIR\bin\Uninstall.exe"
+ Delete "$INSTDIR\jre\jre\bin\client\classes.jsa"
+
+ Push "Complete"
+ Push "$INSTDIR\bin\${PRODUCT_EXE_FILE}.vmoptions"
+ Push "$INSTDIR\bin\idea.properties"
+ ${UnStrRep} $0 ${PRODUCT_EXE_FILE} ".exe" "64.exe.vmoptions"
+ Push "$INSTDIR\bin\$0"
+ Call un.compareFileInstallationTime
+ ${If} $9 != "Modified"
+ RMDir /r "$INSTDIR"
+ ${Else}
+ !include "unidea_win.nsh"
+ RMDir "$INSTDIR"
+ ${EndIf}
+
+ ReadRegStr $R9 HKCU "Software\${MANUFACTURER}\${PRODUCT_REG_VER}" "MenuFolder"
+ StrCmp $R9 "" "" clear_shortcuts
+ ReadRegStr $R9 HKLM "Software\${MANUFACTURER}\${PRODUCT_REG_VER}" "MenuFolder"
+ StrCmp $R9 "" clear_Registry
+ StrCpy $baseRegKey "HKLM"
+ StrCpy $5 "Software\${MANUFACTURER}"
+; call un.winVersion
+; ${If} $0 == "1"
+; StrCpy $5 "Software\Wow6432Node\${MANUFACTURER}"
+; ${EndIf}
+clear_shortcuts:
+ ;the user has the admin rights
+; UserInfo::GetAccountType
+; Pop $R2
+ IfFileExists "$DESKTOP\${PRODUCT_FULL_NAME_WITH_VER}.lnk" keep_current_user
+ SetShellVarContext all
+keep_current_user:
+ DetailPrint "Start Menu: $SMPROGRAMS\$R9\${PRODUCT_FULL_NAME_WITH_VER}"
+
+ Delete "$SMPROGRAMS\$R9\${PRODUCT_FULL_NAME_WITH_VER}.lnk"
+; Delete "$SMPROGRAMS\$R9\Uninstall ${PRODUCT_FULL_NAME_WITH_VER}.lnk"
+; Delete only if empty (last IDEA version is uninstalled)
+ RMDir "$SMPROGRAMS\$R9"
+
+ Delete "$DESKTOP\${PRODUCT_FULL_NAME_WITH_VER}.lnk"
+ Delete "$QUICKLAUNCH\${PRODUCT_FULL_NAME_WITH_VER}.lnk"
+
+clear_Registry:
+ StrCpy $5 "Software\${MANUFACTURER}"
+; call un.winVersion
+; ${If} $0 == "1"
+; StrCpy $5 "Software\Wow6432Node\${MANUFACTURER}"
+; ${EndIf}
+
+ StrCpy $0 $baseRegKey
+ StrCpy $1 "$5\${PRODUCT_REG_VER}"
+ StrCpy $2 "MenuFolder"
+ Call un.OMDeleteRegValue
+
+ StrCmp "${PRODUCT_FULL_NAME}" "IntelliJ IDEA Community Edition" restore_java_association
+ StrCmp "${PRODUCT_FULL_NAME}" "IntelliJ IDEA" 0 finish_uninstall
+restore_java_association:
+ StrCpy $1 ".java"
+ StrCpy $2 "backup_val"
+ Call un.ReturnBackupRegValue
+
+finish_uninstall:
+
+ StrCpy $1 "$5\${PRODUCT_REG_VER}"
+ StrCpy $2 "Build"
+ Call un.OMDeleteRegValue
+ StrCpy $2 ""
+ Call un.OMDeleteRegValue
+
+ StrCpy $1 "$5\${PRODUCT_REG_VER}"
+ Call un.OMDeleteRegKeyIfEmpty
+
+ StrCpy $1 "$5\${MUI_PRODUCT}"
+ Call un.OMDeleteRegKeyIfEmpty
+
+ StrCpy $1 "$5"
+ Call un.OMDeleteRegKeyIfEmpty
+
+ DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}"
+
+; UNCOMMENT THIS IN RELEASE BUILD
+; ExecShell "" "http://www.jetbrains.com/idea/uninstall/"
+
+SectionEnd
diff --git a/build/conf/nsis/idea_en.nsi b/build/conf/nsis/idea_en.nsi
new file mode 100644
index 000000000000..bff5dabadebf
--- /dev/null
+++ b/build/conf/nsis/idea_en.nsi
@@ -0,0 +1,22 @@
+; Installation Options page
+LangString installation_options ${LANG_ENGLISH} "Installation Options"
+LangString installation_options_prompt ${LANG_ENGLISH} "Configure your ${MUI_PRODUCT} installation"
+LangString create_desktop_shortcut ${LANG_ENGLISH} "Create Desktop shortcut"
+LangString create_quick_launch_shortcut ${LANG_ENGLISH} "Create Quick Launch shortcut"
+LangString install_for_current_user_only ${LANG_ENGLISH} "Install for current user only"
+
+; Uninstall options page
+LangString uninstall_options ${LANG_ENGLISH} "Uninstall ${MUI_PRODUCT}"
+LangString uninstall_options_prompt ${LANG_ENGLISH} "Remove ${MUI_PRODUCT} from your computer"
+LangString prompt_delete_settings ${LANG_ENGLISH} "Please confirm if you would like to delete the caches and settings of ${MUI_PRODUCT}."
+LangString confirm_delete_caches ${LANG_ENGLISH} "Delete ${MUI_PRODUCT} ${MUI_VERSION_MAJOR} caches and local history"
+LangString confirm_delete_settings ${LANG_ENGLISH} "Delete ${MUI_PRODUCT} ${MUI_VERSION_MAJOR} settings and installed plugins"
+
+; Installation message boxes
+LangString current_version_already_installed ${LANG_ENGLISH} "Current version of ${MUI_PRODUCT} is already installed. Do you wish to continue?"
+LangString uninstall_previous_installations_title ${LANG_ENGLISH} "Uninstall old version(s)"
+LangString uninstall_previous_installations ${LANG_ENGLISH} "Installation found an old version(s) of ${MUI_PRODUCT}. You can see list of the installations below."
+LangString uninstall_previous_installations_prompt ${LANG_ENGLISH} "Please select the version(s) of ${MUI_PRODUCT} which you would like to uninstall and mode of uninstallation."
+LangString empty_or_upgrade_folder ${LANG_ENGLISH} "Please select an empty folder or a folder where ${MUI_PRODUCT} ${UPGRADE_VERSION} is installed as the target for installing ${MUI_PRODUCT}."
+LangString application_running ${LANG_ENGLISH} "Installation detects that $3 is running. Can you stop the application and then continue uninstallation please?"
+
diff --git a/build/conf/nsis/idea_jp.nsi b/build/conf/nsis/idea_jp.nsi
new file mode 100644
index 000000000000..4b57c5ac5d92
--- /dev/null
+++ b/build/conf/nsis/idea_jp.nsi
@@ -0,0 +1,18 @@
+; Installation Options page
+LangString installation_options ${LANG_JAPANESE} "CXg[ IvV"
+LangString installation_options_prompt ${LANG_JAPANESE} "${MUI_PRODUCT} CXg[ݒ肵܂"
+LangString create_desktop_shortcut ${LANG_JAPANESE} "fXNgbvɃV[gJbg쐬"
+LangString create_quick_launch_shortcut ${LANG_JAPANESE} "NCbNNɃV[gJbg쐬"
+LangString install_for_current_user_only ${LANG_JAPANESE} "݂̃[U[ɑ΂Ă̂݃CXg["
+
+; Uninstall options page
+LangString uninstall_options ${LANG_JAPANESE} "${MUI_PRODUCT} ACXg[܂"
+LangString uninstall_options_prompt ${LANG_JAPANESE} "Rs[^ ${MUI_PRODUCT} 폜܂"
+LangString prompt_delete_settings ${LANG_JAPANESE} "${MUI_PRODUCT} ̐ݒƃLbV폜邩ǂmFĂ"
+LangString confirm_delete_caches ${LANG_JAPANESE} "${MUI_PRODUCT} ̃LbVƃ[J폜"
+LangString confirm_delete_settings ${LANG_JAPANESE} "${MUI_PRODUCT} ̐ݒƃCXg[ς݂̃vOC폜"
+
+; Installation message boxes
+LangString current_version_already_installed ${LANG_JAPANESE} "${MUI_PRODUCT} ݂̌̃o[W͊ɃCXg[Ă܂B CXg[𑱍s܂ ?"
+LangString empty_or_upgrade_folder ${LANG_JAPANESE} "̃tH_܂ ${MUI_PRODUCT} ̃^[QbgƂ IntelliJ IDEA 5.0 CXg[tH_IĂB"
+
diff --git a/build/conf/nsis/paths.nsi b/build/conf/nsis/paths.nsi
new file mode 100644
index 000000000000..c9cc2cd6dfa2
--- /dev/null
+++ b/build/conf/nsis/paths.nsi
@@ -0,0 +1,6 @@
+; Installer images
+!define IMAGES_LOCATION ${BASE_DIR}\build\images\idea
+!define LICENSE_FILE ${BASE_DIR}\license\IDEA_license
+!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\release\dist.all\bin\idea.properties
+!define PRODUCT_VM_OPTIONS_NAME idea*.exe.vmoptions
+!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\release\dist.win\bin\${PRODUCT_VM_OPTIONS_NAME} \ No newline at end of file
diff --git a/build/conf/nsis/pathsCE.nsi b/build/conf/nsis/pathsCE.nsi
new file mode 100644
index 000000000000..f168e1f41024
--- /dev/null
+++ b/build/conf/nsis/pathsCE.nsi
@@ -0,0 +1,5 @@
+; Installer images
+!define IMAGES_LOCATION ${BASE_DIR}\build\images\idea
+!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\release\dist.all.ce\bin\idea.properties
+!define PRODUCT_VM_OPTIONS_NAME idea*.exe.vmoptions
+!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\release\dist.win.ce\bin\${PRODUCT_VM_OPTIONS_NAME} \ No newline at end of file
diff --git a/build/conf/nsis/registry.nsi b/build/conf/nsis/registry.nsi
new file mode 100644
index 000000000000..292a5d3f8493
--- /dev/null
+++ b/build/conf/nsis/registry.nsi
@@ -0,0 +1,75 @@
+; -----------------------------------------------------------------------------
+; OMReadRegStr
+; $0 - root_key ("HKCU" | "HKLM")
+; $1 - subkey
+; $2 - value name
+; $3 - result
+
+Function OMReadRegStr
+ StrCmp $0 "HKCU" hkcu
+ ReadRegStr $3 HKLM $1 $2
+ goto done
+hkcu:
+ ReadRegStr $3 HKCU $1 $2
+done:
+FunctionEnd
+
+; -----------------------------------------------------------------------------
+; OMDeleteRegValue
+; $0 - root_key ("HKCU" | "HKLM")
+; $1 - subkey
+; $2 - value name
+
+Function OMDeleteRegValue
+ StrCmp $0 "HKCU" hkcu
+ DeleteRegValue HKLM $1 $2
+ goto done
+hkcu:
+ DeleteRegValue HKCU $1 $2
+done:
+FunctionEnd
+
+; -----------------------------------------------------------------------------
+; OMDeleteRegKeyIfEmpty
+; $0 - root_key ("HKCU" | "HKLM")
+; $1 - subkey
+
+Function OMDeleteRegKeyIfEmpty
+ StrCmp $0 "HKCU" hkcu
+ DeleteRegKey /ifempty HKLM $1
+ goto done
+hkcu:
+ DeleteRegKey /ifempty HKCU $1
+done:
+FunctionEnd
+
+; -----------------------------------------------------------------------------
+; OMDeleteRegKey
+; $0 - root_key ("HKCU" | "HKLM")
+; $1 - subkey
+
+Function OMDeleteRegKey
+ StrCmp $0 "HKCU" hkcu
+ DeleteRegKey /ifempty HKLM $1
+ goto done
+hkcu:
+ DeleteRegKey /ifempty HKCU $1
+done:
+FunctionEnd
+
+
+; -----------------------------------------------------------------------------
+; OMWriteRegStr
+; $0 - root_key ("HKCU" | "HKLM")
+; $1 - subkey
+; $2 - value name
+; $3 - value
+
+Function OMWriteRegStr
+ StrCmp $0 "HKCU" hkcu
+ WriteRegStr HKLM $1 $2 $3
+ goto done
+hkcu:
+ WriteRegStr HKCU $1 $2 $3
+done:
+FunctionEnd
diff --git a/build/conf/nsis/strings.nsi b/build/conf/nsis/strings.nsi
new file mode 100644
index 000000000000..9672e05753bf
--- /dev/null
+++ b/build/conf/nsis/strings.nsi
@@ -0,0 +1,13 @@
+!define MANUFACTURER "JetBrains"
+!define MUI_PRODUCT "IntelliJ IDEA"
+!define PRODUCT_FULL_NAME "IntelliJ IDEA"
+!define PRODUCT_EXE_FILE "idea.exe"
+!define PRODUCT_ICON_FILE "idea_inst.ico"
+!define PRODUCT_UNINST_ICON_FILE "idea_uninst.ico"
+!define PRODUCT_LOGO_FILE "logo.bmp"
+!define PRODUCT_HEADER_FILE "headerlogo.bmp"
+
+; if SHOULD_SET_DEFAULT_INSTDIR != 0 then default installation directory will be directory where highest-numbered IDEA build has been installed
+; set to 1 for release build
+!define SHOULD_SET_DEFAULT_INSTDIR "0"
+
diff --git a/build/conf/nsis/stringsCE.nsi b/build/conf/nsis/stringsCE.nsi
new file mode 100644
index 000000000000..3053ade3094e
--- /dev/null
+++ b/build/conf/nsis/stringsCE.nsi
@@ -0,0 +1,13 @@
+!define MANUFACTURER "JetBrains"
+!define MUI_PRODUCT "IntelliJ IDEA Community Edition"
+!define PRODUCT_FULL_NAME "IntelliJ IDEA Community Edition"
+!define PRODUCT_EXE_FILE "idea.exe"
+!define PRODUCT_ICON_FILE "idea_CEinst.ico"
+!define PRODUCT_UNINST_ICON_FILE "idea_CEuninst.ico"
+!define PRODUCT_LOGO_FILE "logoCE.bmp"
+!define PRODUCT_HEADER_FILE "headerlogoCE.bmp"
+
+; if SHOULD_SET_DEFAULT_INSTDIR != 0 then default installation directory will be directory where highest-numbered IDEA build has been installed
+; set to 1 for release build
+!define SHOULD_SET_DEFAULT_INSTDIR "0"
+
diff --git a/build/conf/nsis/version.eap.nsi b/build/conf/nsis/version.eap.nsi
new file mode 100644
index 000000000000..bea430c6acf2
--- /dev/null
+++ b/build/conf/nsis/version.eap.nsi
@@ -0,0 +1,13 @@
+!define MUI_VERSION_MAJOR "__VERSION_MAJOR__"
+!define MUI_VERSION_MINOR "__VERSION_MINOR__"
+
+!define VER_BUILD __BUILD_NUMBER__
+
+!define MIN_UPGRADE_BUILD __MIN_UPGRADE_BUILD__
+!define MAX_UPGRADE_BUILD __MAX_UPGRADE_BUILD__
+!define UPGRADE_VERSION __UPGRADE_VERSION__
+
+!define PRODUCT_WITH_VER "${MUI_PRODUCT} ${VER_BUILD}"
+!define PRODUCT_FULL_NAME_WITH_VER "${PRODUCT_FULL_NAME} ${VER_BUILD}"
+!define PRODUCT_PATHS_SELECTOR "__PRODUCT_PATHS_SELECTOR__"
+!define PRODUCT_SETTINGS_DIR ".${PRODUCT_PATHS_SELECTOR}"
diff --git a/build/conf/nsis/version.nsi b/build/conf/nsis/version.nsi
new file mode 100644
index 000000000000..152bef1ff438
--- /dev/null
+++ b/build/conf/nsis/version.nsi
@@ -0,0 +1,13 @@
+!define MUI_VERSION_MAJOR "__VERSION_MAJOR__"
+!define MUI_VERSION_MINOR "__VERSION_MINOR__"
+
+!define VER_BUILD __BUILD_NUMBER__
+
+!define MIN_UPGRADE_BUILD __MIN_UPGRADE_BUILD__
+!define MAX_UPGRADE_BUILD __MAX_UPGRADE_BUILD__
+!define UPGRADE_VERSION __UPGRADE_VERSION__
+
+!define PRODUCT_WITH_VER "${MUI_PRODUCT} ${MUI_VERSION_MAJOR}.${MUI_VERSION_MINOR}"
+!define PRODUCT_FULL_NAME_WITH_VER "${PRODUCT_FULL_NAME} ${MUI_VERSION_MAJOR}.${MUI_VERSION_MINOR}"
+!define PRODUCT_PATHS_SELECTOR "__PRODUCT_PATHS_SELECTOR__"
+!define PRODUCT_SETTINGS_DIR ".${PRODUCT_PATHS_SELECTOR}" \ No newline at end of file
diff --git a/build/lib/NsiFiles.jar b/build/lib/NsiFiles.jar
new file mode 100644
index 000000000000..1c51e070d67f
--- /dev/null
+++ b/build/lib/NsiFiles.jar
Binary files differ
diff --git a/build/scripts/layouts.gant b/build/scripts/layouts.gant
index 4e0429785968..277b4e93291d 100644
--- a/build/scripts/layouts.gant
+++ b/build/scripts/layouts.gant
@@ -112,6 +112,12 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
fileset(dir: "${home}/lib/rt", includesfile: "${home}/lib/rt/required_for_dist.txt")
}
+ dir("groovy") {
+ dir("lib") {
+ fileset(dir:"$home/lib/groovy/lib")
+ }
+ }
+
jar("util.jar") {
module("util")
module("util-rt")
diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant
index bd314d670c14..8f0e940630ab 100644
--- a/build/scripts/utils.gant
+++ b/build/scripts/utils.gant
@@ -774,3 +774,67 @@ binding.setVariable("buildWinLauncher", { String ch, String inputPath, String ou
launcherPropertiesTempFile.delete()
}
})
+
+binding.setVariable("buildModulesAndCollectUsedJars", { List modules, List approvedJars, List forbiddenJars ->
+ def usedJars = new HashSet();
+
+ projectBuilder.cleanOutput()
+ def modulesToBuild = []
+ modules.each {
+ def module = findModule(it)
+ if (module != null) {
+ projectBuilder.moduleRuntimeClasspath(module, false).each {
+ File file = new File(it)
+ if (file.exists()) {
+ String path = file.canonicalPath.replace('\\', '/')
+ if (path.endsWith(".jar") && approvedJars.any { path.startsWith(it) } && !forbiddenJars.any { path.contains(it) }) {
+ if (usedJars.add(path)) {
+ projectBuilder.info("\tADDED: $path for ${module.getName()}")
+ }
+ }
+ }
+ }
+ modulesToBuild << module
+ }
+ else {
+ projectBuilder.warning("$it is not a module")
+ }
+ }
+ projectBuilder.buildModules(modulesToBuild)
+
+ return usedJars
+})
+
+binding.setVariable("buildSearchableOptions", { String target, List licenses, Closure cp, String jvmArgs = null,
+ def paths = getProperty("paths") ->
+ projectBuilder.stage("Building searchable options")
+
+ String targetFile = "${target}/searchableOptions.xml"
+ ant.delete(file: targetFile)
+
+ licenses.each {
+ ant.copy(file: it, todir: paths.ideaSystem)
+ }
+
+ ant.path(id: "searchable.options.classpath") { cp() }
+ String classpathFile = "${paths.sandbox}/classpath.txt"
+ ant.echo(file: classpathFile, append: false, message: "\${toString:searchable.options.classpath}")
+ ant.replace(file: classpathFile, token: File.pathSeparator, value: "\n")
+
+ ant.java(classname: "com.intellij.rt.execution.CommandLineWrapper", fork: true, failonerror: true) {
+ jvmarg(line: "-Xbootclasspath/a:${projectBuilder.moduleOutput(findModule("boot"))} -ea -Xmx500m -XX:MaxPermSize=200m")
+ jvmarg(line: "-Didea.home.path=$home -Didea.system.path=${paths.ideaSystem} -Didea.config.path=${paths.ideaConfig}")
+ if (jvmArgs != null) {
+ jvmarg(line: jvmArgs)
+ }
+
+ arg(line: "${classpathFile} com.intellij.idea.Main traverseUI ${target}/searchableOptions.xml")
+
+ classpath() {
+ pathelement(location: "${projectBuilder.moduleOutput(findModule("java-runtime"))}")
+ }
+ }
+
+ ant.available(file: targetFile, property: "searchable.options.exists");
+ ant.fail(unless: "searchable.options.exists", message: "Searchable options were not built.")
+})
diff --git a/build/src/com/intellij/internalUtilities/ant/NsiFiles.java b/build/src/com/intellij/internalUtilities/ant/NsiFiles.java
new file mode 100644
index 000000000000..b19062870eb1
--- /dev/null
+++ b/build/src/com/intellij/internalUtilities/ant/NsiFiles.java
@@ -0,0 +1,198 @@
+package com.intellij.internalUtilities.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.FileSet;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * Ant task to facilitate building NSIS installer.
+ *
+ * @author max
+ * @since Jan 11, 2005
+ */
+@SuppressWarnings("UnusedDeclaration")
+public class NsiFiles extends MatchingTask {
+ private File myInstFile;
+ private File myUnInstFile;
+ private File myBaseDir;
+ private final List<FileSet> myFileSets = new ArrayList<FileSet>();
+ private final Map<String, List<String>> myDirToFiles = new LinkedHashMap<String, List<String>>();
+ private final Map<String, String> myAbsoluteToRelative = new HashMap<String, String>();
+
+ /**
+ * The file to create; required
+ * @param nsiFile new file to generate file install list to.
+ */
+ public void setInstFile(File nsiFile) {
+ myInstFile = nsiFile;
+ }
+
+ /**
+ * The file to create; required
+ * @param nsiFile new file to generate file uninstall list to.
+ */
+ public void setUninstFile(File nsiFile) {
+ myUnInstFile = nsiFile;
+ }
+
+ /**
+ * ;optional
+ * @param fileSet to be included in processing
+ */
+ public void addFileSet(FileSet fileSet) {
+ myFileSets.add(fileSet);
+ }
+
+ /**
+ * ;optional
+ * @param baseDir of the files to be processed.
+ */
+ public void setBaseDir(File baseDir) {
+ myBaseDir = baseDir;
+ }
+
+ public void execute() throws BuildException {
+ if (myInstFile == null) throw new BuildException("Specify required isntFile attribute.");
+ if (myUnInstFile == null) throw new BuildException("Specify required unisntFile attribute.");
+
+ if (myBaseDir == null && myFileSets.size() == 0) {
+ throw new BuildException("basedir attribute must be set, "
+ + "or at least "
+ + "one fileset must be given!");
+ }
+
+ try {
+ if (myBaseDir != null) {
+ FileSet fs = (FileSet) getImplicitFileSet().clone();
+ fs.setDir(myBaseDir);
+ processFileSet(fs);
+ }
+
+ for (FileSet fileSet : myFileSets) {
+ processFileSet(fileSet);
+ }
+
+ generateInstFile();
+ generateUninstFile();
+ }
+ catch (IOException e) {
+ throw new BuildException(e);
+ }
+ finally {
+ cleanup();
+ }
+ }
+
+ private void generateUninstFile() throws IOException {
+ BufferedWriter uninstWriter = new BufferedWriter(new FileWriter(myUnInstFile));
+ try {
+ List<String> allFiles = new ArrayList<String>();
+ final Collection<List<String>> lists = myDirToFiles.values();
+ for (final List<String> list : lists) {
+ allFiles.addAll(list);
+ }
+
+ Collections.sort(allFiles);
+ for (String file : allFiles) {
+ uninstWriter.newLine();
+ final String relPath = myAbsoluteToRelative.get(file);
+ uninstWriter.write("Delete \"$INSTDIR\\" + relPath + "\"");
+ if (relPath.endsWith(".py")) {
+ uninstWriter.newLine();
+ uninstWriter.write("Delete \"$INSTDIR\\" + relPath + "c\""); // .pyc
+ }
+ }
+
+ uninstWriter.newLine();
+ List<String> dirs = new ArrayList<String>(myDirToFiles.keySet());
+ Collections.sort(dirs);
+ for (int i = dirs.size() - 1; i >= 0; i--) {
+ final String dir = dirs.get(i);
+ if (dir.length() == 0) continue;
+ uninstWriter.newLine();
+ uninstWriter.write("RmDir /r \"$INSTDIR\\" + dir + "\\__pycache__\"");
+ uninstWriter.newLine();
+ uninstWriter.write("RmDir \"$INSTDIR\\" + dir + "\"");
+ }
+ uninstWriter.newLine();
+ uninstWriter.write("RmDir \"$INSTDIR\"");
+ }
+ finally{
+ uninstWriter.close();
+ }
+ }
+
+ private void generateInstFile() throws IOException {
+ BufferedWriter instWriter = new BufferedWriter(new FileWriter(myInstFile));
+ try {
+ Collection<String> dirs = myDirToFiles.keySet();
+ for (String dir : dirs) {
+ final List<String> files = myDirToFiles.get(dir);
+ if (files.size() == 0) continue;
+ instWriter.newLine();
+ instWriter.newLine();
+ if (dir.length() > 0) {
+ instWriter.write("SetOutPath $INSTDIR\\" + dir);
+ }
+ else {
+ instWriter.write("SetOutPath $INSTDIR");
+ }
+
+ for (String file : files) {
+ instWriter.newLine();
+ instWriter.write("File \"" + file + "\"");
+ }
+ }
+ }
+ finally {
+ instWriter.close();
+ }
+ }
+
+ private void processFileSet(final FileSet fileSet) throws IOException {
+ final DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
+ final String[] files = scanner.getIncludedFiles();
+ String base = fileSet.getDir(getProject()).getCanonicalPath() + "\\";
+ for (String file : files) {
+ String lastDir = "";
+ getDirFileList(lastDir);
+ int idx = -1;
+ do {
+ idx = file.indexOf('\\', idx + 1);
+ if (idx == -1) break;
+ lastDir = file.substring(0, idx);
+ getDirFileList(lastDir);
+ }
+ while (true);
+
+ List<String> fileList = getDirFileList(lastDir);
+ final String absolute = base + file;
+ fileList.add(absolute);
+ myAbsoluteToRelative.put(absolute, file);
+ }
+ }
+
+ private List<String> getDirFileList(final String dir) {
+ List<String> fileList = myDirToFiles.get(dir);
+ if (fileList == null) {
+ fileList = new ArrayList<String>();
+ myDirToFiles.put(dir, fileList);
+ }
+ return fileList;
+ }
+
+ private void cleanup() {
+ myBaseDir = null;
+ myInstFile = null;
+ myFileSets.clear();
+ myDirToFiles.clear();
+ myAbsoluteToRelative.clear();
+ }
+}