Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're creating the directory further down on line 19. Can we not just remove that line and let the installer install wherever it thinks it should? Why do we need to create the directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... originally I had assumed (possibly incorrectly) that the
New-Item -ItemType Directory
step in the original install script was required, but based on my own testing maybe it's not needed anymore? My quick searching seems to imply that it was part of a workaround for this older bug in the Jetbrains installer ( https://youtrack.jetbrains.com/issue/IDEA-202935 ) but it seems that since then the installer bug has been fixed, so this directory creation step might just be vestigial!I can change the PR to remove the unnecessary cruft if you'd prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The directory creation was indeed just because of a bug in the installer that would cause any custom directories used to fail the installation.
If this is now fixed, and works as expected, then I agree with @pauby that removing the manual creation of the directory instead of replacing it here.
To note though as well. IMO this wouldn't be the correct approach anyway, as if the directory does not respect the 3rd part of a version number if it is zero, we should not use the
ChocolateyPackageVersion
environment variable, but instead a hard-coded value we automatically insert when creating the package.