Closed Ana06 closed 7 months ago
Would changing Copy-Item
to Move-Item
be a viable option here?
It would mitigate the duplication caused by copying and should also mitigate the error.
Would changing Copy-Item to Move-Item be a viable option here?
yes, it is similar to my option 1 to not copy the file in this case. Not sure if it would be confusing for the user, but having two files may also be confusing.
I wonder also if we should move the config file to the VM folder where we store the background picture and other files already instead of using the Desktop.
What's the problem?
If you create a custom config file in the Desktop with the name
config.xml
and execute the installer script, theGet-ConfigFile
function (introduced in https://github.com/mandiant/flare-vm/pull/531) will fail trying to copy the file to itself with the following error:Steps to Reproduce
config.xml
andinstall.ps1
to the Desktop (the name and location ofconfig.xml
are important to reproduce the error..\install.ps1 -customConfig config.xml -noGui
Environment
It is not environment specific.
Fix proposals
Workaround
Moving the config file to a different location (different from the
Desktop
) or renaming the config file allows to run the install script sucessfully.Fix proposal 1
Add a check to the
Get-ConfigFile
function to avoid copying the file if source and destination are the same. This has the problem that we duplicate the config file in the Desktop when providing an argument.Fix proposal 2
Do not copy the file in
Get-ConfigFile
as we did before https://github.com/mandiant/flare-vm/pull/531