Jump to content

sfx Presetup


sugargenius

Recommended Posts

I'm trying to create a winrar sfx that extracts to a directory and then runs a batch file. If the destination dir already exists, I want to delete it. I thought I could do this with Presetup:

Path=C:\myapp
Presetup=cmd /c rmdir /s /q C:\myapp
Setup=temp\run.cmd
Silent=2
Overwrite=1
Title=Myappp

It doesn't delete the c:\myapp folder. What am I missing? I tried this too:

Path=C:\myapp

Presetup="cmd /c rmdir /s /q C:\myapp"

Setup=temp\run.cmd

Silent=2

Overwrite=1

Title=Myappp

Link to comment
Share on other sites


i never came across with a need to delete some folder prior to extracting an sfx archive.

try other commands to se if the presetup is working.

remember that if you use overwrite=1 any file that exist will be overwritten, so if you are trying to delete the folder because of this, you are safe with overwrite=1.

Link to comment
Share on other sites

  • 1 year later...

For future googlers...

The Presetup step ignores the system's PATH, that's why simply using 'cmd' doesn't work.

On the other hand, environment variables do get expanded, so you can write this instead:

Presetup=%ComSpec% /c rmdir /s /q C:\myapp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...