www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Uninstall deletes user created folders too

reply John J <john.joyus gmail.com> writes:
The Uninstall on Windows is deleting user created folders too! :(

I thought it's a good idea to uninstall the previous version of D before 
I install the latest one, but when I did that, it deleted the C:\D 
folder, including the sub-folders and files I created under that "D" 
folder! :(

This is most unusual behavior. Can someone please fix the installer?

And as I was panic, I made a quick search and installed Recuva to 
undelete the files.. but sadly it overwrote the important files I 
thought of recovering! (I guess I should have tried it from a different 
partition or a USB stick).
Jan 08 2014
next sibling parent reply "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 The Uninstall on Windows is deleting user created folders too! 
 :(

 I thought it's a good idea to uninstall the previous version of 
 D before I install the latest one, but when I did that, it 
 deleted the C:\D folder, including the sub-folders and files I 
 created under that "D" folder! :(

 This is most unusual behavior. Can someone please fix the 
 installer?

 And as I was panic, I made a quick search and installed Recuva 
 to undelete the files.. but sadly it overwrote the important 
 files I thought of recovering! (I guess I should have tried it 
 from a different partition or a USB stick).
I've made a pull request to fix this: https://github.com/D-Programming-Language/installer/pull/37 It only will avoid removing the installation folder if the root is empty. With this change you can safely add stuff to the root of the installation folder but if you add stuff to the C:\D\{dm,dmd,dmd2} folders they will still be deleted. I'd like it to only remove files that were installed but it'd need an exact list and we don't have that at the moment.
Jan 08 2014
parent reply "eles" <eles eles.com> writes:
On Thursday, 9 January 2014 at 07:11:21 UTC, Brad Anderson wrote:
 On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 exact list and we don't have that at the moment.
why not create the list during the installation? just scan the archive or whatever to find out the files that are to be deployed and store those in a list (if successfully deployed).
Jan 09 2014
next sibling parent reply Marco Leise <Marco.Leise gmx.de> writes:
Am Thu, 09 Jan 2014 09:12:30 +0000
schrieb "eles" <eles eles.com>:

 On Thursday, 9 January 2014 at 07:11:21 UTC, Brad Anderson wrote:
 On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 exact list and we don't have that at the moment.
why not create the list during the installation? just scan the archive or whatever to find out the files that are to be deployed and store those in a list (if successfully deployed).
Why not use an installer that has this functionality built in? I would have thought that this is basic stuff for any installer. -- Marco
Jan 09 2014
next sibling parent John J <john.joyus gmail.com> writes:
On 01/09/2014 10:07 AM, Marco Leise wrote:
 Why not use an installer that has this functionality built in?
 I would have thought that this is basic stuff for any
 installer.
Inno Setup has pretty good support for this kind of things and a lot more.. http://www.jrsoftware.org/isinfo.php
Jan 09 2014
prev sibling parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Thursday, 9 January 2014 at 15:07:02 UTC, Marco Leise wrote:
 Why not use an installer that has this functionality built in?
 I would have thought that this is basic stuff for any
 installer.
As I understand, the compiler is not included in the installer - the installer downloads a ZIP file with the compiler from the DM website/CDN and unpacks it. The problem is knowing exactly which files came from the ZIP file.
Jan 09 2014
next sibling parent reply "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 16:34:53 UTC, Vladimir Panteleev 
wrote:
 On Thursday, 9 January 2014 at 15:07:02 UTC, Marco Leise wrote:
 Why not use an installer that has this functionality built in?
 I would have thought that this is basic stuff for any
 installer.
As I understand, the compiler is not included in the installer - the installer downloads a ZIP file with the compiler from the DM website/CDN and unpacks it. The problem is knowing exactly which files came from the ZIP file.
Exactly. Just preparing a list wouldn't be terribly hard in most languages but NSIS isn't exactly the easiest scripting language to do just about anything in.
Jan 09 2014
parent reply Jacob Carlborg <doob me.com> writes:
On 2014-01-09 18:53, Brad Anderson wrote:

 Exactly. Just preparing a list wouldn't be terribly hard in most
 languages but NSIS isn't exactly the easiest scripting language to do
 just about anything in.
You can't call out to an external script? -- /Jacob Carlborg
Jan 09 2014
parent reply "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 20:02:22 UTC, Jacob Carlborg wrote:
 On 2014-01-09 18:53, Brad Anderson wrote:

 Exactly. Just preparing a list wouldn't be terribly hard in 
 most
 languages but NSIS isn't exactly the easiest scripting 
 language to do
 just about anything in.
You can't call out to an external script?
You can run arbitrary programs while the installer runs, sure (good idea). You can't run programs/scripts while building the installer itself however.
Jan 09 2014
parent Jacob Carlborg <doob me.com> writes:
On 2014-01-10 01:09, Brad Anderson wrote:

 You can run arbitrary programs while the installer runs, sure (good
 idea).  You can't run programs/scripts while building the installer
 itself however.
If you feel you're limited by the language, move it to a script file, either batch or JScript and call that when installing. -- /Jacob Carlborg
Jan 09 2014
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2014-01-09 17:34, Vladimir Panteleev wrote:

 As I understand, the compiler is not included in the installer - the
 installer downloads a ZIP file with the compiler from the DM website/CDN
 and unpacks it. The problem is knowing exactly which files came from the
 ZIP file.
Just unpack it in a temporary folder an inspect which files are in the package. -- /Jacob Carlborg
Jan 09 2014
prev sibling parent reply "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 09:12:31 UTC, eles wrote:
 On Thursday, 9 January 2014 at 07:11:21 UTC, Brad Anderson 
 wrote:
 On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 exact list and we don't have that at the moment.
why not create the list during the installation? just scan the archive or whatever to find out the files that are to be deployed and store those in a list (if successfully deployed).
That's what needs to be done. NSIS doesn't make doing things like this easy because the scripting language is very...barebones. There are readymade solutions for installers that use the regular packaging of installed files but we download a zip and install the contents of that so we'd need to create something ourselves (or adapt one of the readymade solutions to work with what we do).
Jan 09 2014
parent reply Jacob Carlborg <doob me.com> writes:
On 2014-01-09 18:58, Brad Anderson wrote:

 That's what needs to be done. NSIS doesn't make doing things like this
 easy because the scripting language is very...barebones. There are
 readymade solutions for installers that use the regular packaging of
 installed files but we download a zip and install the contents of that
 so we'd need to create something ourselves (or adapt one of the
 readymade solutions to work with what we do).
Why do you need to download the zip, just include the files you need like a regular installer. -- /Jacob Carlborg
Jan 09 2014
parent reply "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 20:03:44 UTC, Jacob Carlborg wrote:
 On 2014-01-09 18:58, Brad Anderson wrote:

 That's what needs to be done. NSIS doesn't make doing things 
 like this
 easy because the scripting language is very...barebones. There 
 are
 readymade solutions for installers that use the regular 
 packaging of
 installed files but we download a zip and install the contents 
 of that
 so we'd need to create something ourselves (or adapt one of the
 readymade solutions to work with what we do).
Why do you need to download the zip, just include the files you need like a regular installer.
The decision to do that predates my interest in D so I'm not sure why the installer does that. It supports just embedding the zip but that's never been used to my knowledge. Even better would be to use NSIS's own archiving (which supports LZMA).
Jan 09 2014
parent reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Friday, 10 January 2014 at 00:07:43 UTC, Brad Anderson wrote:
 Why do you need to download the zip, just include the files 
 you need like a regular installer.
The decision to do that predates my interest in D so I'm not sure why the installer does that. It supports just embedding the zip but that's never been used to my knowledge. Even better would be to use NSIS's own archiving (which supports LZMA).
I believe it was because the installer was not an official package, since you can't distribute DMD without permission it was opted to just download the zip. Now that it is official, there shouldn't be any reason other than desire and "that's the way it's always been."
Jan 09 2014
parent Jacob Carlborg <doob me.com> writes:
On 2014-01-10 06:31, Jesse Phillips wrote:

 I believe it was because the installer was not an official package,
 since you can't distribute DMD without permission it was opted to just
 download the zip. Now that it is official, there shouldn't be any reason
 other than desire and "that's the way it's always been."
Exactly, my point. -- /Jacob Carlborg
Jan 09 2014
prev sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 The Uninstall on Windows is deleting user created folders too! 
 :(

 I thought it's a good idea to uninstall the previous version of 
 D before I install the latest one, but when I did that, it 
 deleted the C:\D folder, including the sub-folders and files I 
 created under that "D" folder! :(

 This is most unusual behavior. Can someone please fix the 
 installer?

 And as I was panic, I made a quick search and installed Recuva 
 to undelete the files.. but sadly it overwrote the important 
 files I thought of recovering! (I guess I should have tried it 
 from a different partition or a USB stick).
This is the second time this has come up. While I agree that leaving the D folder intact would be a safe default, it still seems weird that anyone would put anything irreplaceable in that folder. In my mind I always saw it as the equivalent of putting something in a particular program's Program Files subdir, i.e. you're likely to see it wiped if you uninstall it.
Jan 09 2014
next sibling parent reply Orvid King <blah38621 gmail.com> writes:
On 1/9/14, John Colvin <john.loughran.colvin gmail.com> wrote:
 On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 The Uninstall on Windows is deleting user created folders too!
 :(

 I thought it's a good idea to uninstall the previous version of
 D before I install the latest one, but when I did that, it
 deleted the C:\D folder, including the sub-folders and files I
 created under that "D" folder! :(

 This is most unusual behavior. Can someone please fix the
 installer?

 And as I was panic, I made a quick search and installed Recuva
 to undelete the files.. but sadly it overwrote the important
 files I thought of recovering! (I guess I should have tried it
 from a different partition or a USB stick).
This is the second time this has come up. While I agree that leaving the D folder intact would be a safe default, it still seems weird that anyone would put anything irreplaceable in that folder. In my mind I always saw it as the equivalent of putting something in a particular program's Program Files subdir, i.e. you're likely to see it wiped if you uninstall it.
I keep my git head version of D, and consequentially, my single-click update & build script, in my C:\D folder, and I think that it is the best place to put it.
Jan 09 2014
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Thursday, 9 January 2014 at 13:28:46 UTC, Orvid King wrote:
 On 1/9/14, John Colvin <john.loughran.colvin gmail.com> wrote:
 On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote:
 The Uninstall on Windows is deleting user created folders too!
 :(

 I thought it's a good idea to uninstall the previous version 
 of
 D before I install the latest one, but when I did that, it
 deleted the C:\D folder, including the sub-folders and files I
 created under that "D" folder! :(

 This is most unusual behavior. Can someone please fix the
 installer?

 And as I was panic, I made a quick search and installed Recuva
 to undelete the files.. but sadly it overwrote the important
 files I thought of recovering! (I guess I should have tried it
 from a different partition or a USB stick).
This is the second time this has come up. While I agree that leaving the D folder intact would be a safe default, it still seems weird that anyone would put anything irreplaceable in that folder. In my mind I always saw it as the equivalent of putting something in a particular program's Program Files subdir, i.e. you're likely to see it wiped if you uninstall it.
I keep my git head version of D, and consequentially, my single-click update & build script, in my C:\D folder, and I think that it is the best place to put it.
sure, it's neat. But still, I would never do it myself. Installers and uninstallers are notorious for touching more than they need to.
Jan 09 2014
prev sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 13:28:46 UTC, Orvid King wrote:
 I keep my git head version of D, and consequentially, my 
 single-click
 update & build script, in my C:\D folder, and I think that it 
 is the
 best place to put it.
I keep mine in C:\D-git with an identical directory structure as C:\D. Then I copy the dmd2vars{32,64}.bat files over to the root so I can easily choose between using git dmd and released dmd.
Jan 09 2014
prev sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Thursday, 9 January 2014 at 12:29:54 UTC, John Colvin wrote:
 This is the second time this has come up. While I agree that 
 leaving the D folder intact would be a safe default, it still 
 seems weird that anyone would put anything irreplaceable in 
 that folder. In my mind I always saw it as the equivalent of 
 putting something in a particular program's Program Files 
 subdir, i.e. you're likely to see it wiped if you uninstall it.
Before it was because Walter used Jordi's installer which runs the uninstaller prior to installing (which is a good idea usually). I wish I had realized then that having Walter switch it back over to the regular installer wasn't really a true fix for the heart of this problem since the regular installer also removed the entire directory structure.
Jan 09 2014