You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
When you run a Windows installer (built with NSIS) to install a new version of your CLI over the top of an old one, it uninstalls the previous version first, so that files that are obsolete in the new version won't be left behind.
Actual Behavior
The previous version is not uninstalled and old files are retained, potentially causing unexpected application behavior.
Example
Suppose that version 1 of your application has a command that looks like this:
The HelloCommand class delegates the actual execution of the command to another module, src/hello.js:
src/hello.js
module.exports=()=>{console.log('Hello, old world!');};
After people have installed the application, you decide to refactor src/hello.js under a src/hello directory. (In a real world scenario, you might be doing this because the original module has become too complex and you want to break it apart.) So you delete src/hello.js and create this file instead:
src/hello/index.js
module.exports=()=>{console.log('Hello, new world!');};
When you run the hello command, it prints out Hello, new world! as expected, so you build and deploy new installers. However, when people install the new Windows version over the top of an existing installation, the old src/hello.js file does not get deleted. Now the installed application has both src/hello.js and src/hello/index.js, but src/hello.js takes priority on the require(), so when people run it, they get Hello, old world! instead of Hello, new world!.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behavior
When you run a Windows installer (built with NSIS) to install a new version of your CLI over the top of an old one, it uninstalls the previous version first, so that files that are obsolete in the new version won't be left behind.
Actual Behavior
The previous version is not uninstalled and old files are retained, potentially causing unexpected application behavior.
Example
Suppose that version 1 of your application has a command that looks like this:
src/commands/hello.js
The
HelloCommand
class delegates the actual execution of the command to another module,src/hello.js
:src/hello.js
After people have installed the application, you decide to refactor
src/hello.js
under asrc/hello
directory. (In a real world scenario, you might be doing this because the original module has become too complex and you want to break it apart.) So you deletesrc/hello.js
and create this file instead:src/hello/index.js
When you run the
hello
command, it prints outHello, new world!
as expected, so you build and deploy new installers. However, when people install the new Windows version over the top of an existing installation, the oldsrc/hello.js
file does not get deleted. Now the installed application has bothsrc/hello.js
andsrc/hello/index.js
, butsrc/hello.js
takes priority on therequire()
, so when people run it, they getHello, old world!
instead ofHello, new world!
.The text was updated successfully, but these errors were encountered: