diff --git a/setup.py b/setup.py
index f8ab2cd..9791c0f 100644
--- a/setup.py
+++ b/setup.py
@@ -98,7 +98,6 @@ def install_cmdstan_deps(cmdstan_dir: Path):

             raise RuntimeError("CmdStan failed to install in repackaged directory")

-
 def build_cmdstan_model(target_dir):
     """
     Rebuild cmdstan in the build environment, then use this installation to compile the stan model.
@@ -122,12 +121,12 @@ def build_cmdstan_model(target_dir):
         install_cmdstan_deps(cmdstan_dir)
         model_name = "prophet.stan"

-        temp_stan_file = copy(os.path.join(MODEL_DIR, model_name), cmdstan_dir)
+        temp_stan_file = copy(os.path.join(MODEL_DIR, model_name), cmdstan_dir.parent.resolve())
         sm = cmdstanpy.CmdStanModel(stan_file=temp_stan_file)
         target_name = "prophet_model.bin"
         copy(sm.exe_file, os.path.join(target_dir, target_name))

-        if IS_WINDOWS:
+        if IS_WINDOWS and repackage_cmdstan():
             copytree(cmdstan_dir, target_cmdstan_dir)

     # Clean up
