Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to specify what files to uninstall #1298

Closed
mastergberry opened this issue Feb 24, 2017 · 7 comments
Closed

Add option to specify what files to uninstall #1298

mastergberry opened this issue Feb 24, 2017 · 7 comments

Comments

@mastergberry
Copy link
Contributor

mastergberry commented Feb 24, 2017

  • Version: 13.5
  • Target: NSIS

So some of my users apparently think it's a good idea to install their application onto their Desktop or into their Documents folder.....Terrible idea. To be clear instead of installing it into C:\Users\<username>\Desktop\<Application Name> they are doing C:\Users\<username>\Desktop

https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder/templates/nsis/uninstaller.nsh#L42

This line is nuking their other files if they install it into a dumb location.

Is there a way to remove just the files we installed by default and possibly extra files also such as logs or something? I would even just be content with uninstalling the original files we installed and then use the customUnInstall macro to clean up the other ones.

@mastergberry
Copy link
Contributor Author

I submitted a basic PR that will be a smart "temporary" solution assuming the programmer knows what is being bundled in the installation.

In theory all original installed files should be accounted for somewhere in the uninstaller. The current solution gives more power to the programmer to make the decision how they want to uninstall the program.

develar pushed a commit that referenced this issue Feb 24, 2017
…f just nuking installation directory

Temporary solution for #1298 (#1300)
@develar
Copy link
Member

develar commented Feb 24, 2017

It is why we don't allow to choose installation directory by default.

This feature was rejected to be implemented because by default user cannot choose installation directory.

So some of my users apparently think it's a good idea to install their application onto their Desktop or into their Documents folder.....Terrible idea.

Proper solution will be to automatically detect such folders and create subdir for app. Could you please file PR? Because in any case user expects that folder will be created and not bunch of files in Documents:)

@mastergberry
Copy link
Contributor Author

Sure I can attempt it. Will try to submit something in a couple of hours or so.

@mastergberry
Copy link
Contributor Author

@develar So I found where to shove the code and the way I am thinking of doing this at the moment would check the $APP_FILENAME and see if it still in $INSTDIR after the !insertmacro MUI_PAGE_DIRECTORY

I have found this function to help with this http://nsis.sourceforge.net/StrContains

Is there some easier way to do it without having to include this extra function into the installer? If not where should this function be put?

@develar
Copy link
Member

develar commented Feb 24, 2017

where should this function be put?

include dir in the nsis (where StdUtils.nsh is located).

@mastergberry
Copy link
Contributor Author

I created a possible fix although I have not yet had time to test it. I can test it later this weekend or I can submit a PR for you to test/merge it in @develar

@develar
Copy link
Member

develar commented Feb 24, 2017

@mastergberry Looks good for me (but not tested). You can file a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants