Jump to content

WinRAR SFX Guidance


Locke2904

Recommended Posts

Please forgive my ignorance here, but I have built a winrar self extracting archive that can extract almost exactly as I need aside from 1 problem.

I am nowhere near a scripter or programming novice imo, but I need to extract 2 folders with all of their subfolders into 2 different directories. 1 goes into program files and the other goes into %USERNAME%\AppData.

I just set the path to C:\ and it works except I have to manually move the AppData in %USERNAME% folder it creates to the current user... wondering if there is a way to extract this correctly without the extra step here?

What would even be more helpful is being able to extract only under certain conditions so I only need 1 installer instead of 8 different versions.

Is there a way to say extract and overwrite contents but do not create new folders? I would need it to create new files, but not folders, this would ensure it only installs the versions needed when the folders exists.

If any of this has to be handled in command line, could someone point me to "using command line with winrar or batching for complete idiots/noobs"?

Thanks for any information.

Link to comment
Share on other sites


Thanks.

After I posted I started reading about 7zip, but still have a severe lack of knowledge on anything outside of common sense; now i wonder if 7zip would be simpler. The dialogues setup in winrar allow for any id*** to make an installer.

Guess my first question is: How do I start with a custom script or sfx (even a batch)? I see the .sfx in modules, but how do I edit those or setup the rar to execute a .bat upon opening. I am interested to find out where to put the information found in those forum links :blink: .

Basic SFX Info:

Using WinRAR you can create GUI (graphic mode) self-extracting archives for 32-bit Windows version (Windows 95, 98, NT and so on). [These modules cannot be executed under Windows 3.1 or DOS.]

Both these modules support simple setup commands. You may put them to the SFX archive comment. Setup commands are listed below.

Does this mean in the manual comment field that keeps updating when I change almost any of the fields or add a licensing agreement?

I keep googling, but I fail to chose the right terms i think.

Really sorry for the ignorance, but patiently trying to figure this out. My coding, or scripting rather, experience is somewhat limited to Action Script and html - to some degree.

Link to comment
Share on other sites

That's it! That pretty much gives me a whole lot more control over what i want to do.

Thanks. I assume i can just write a .bat to do whatever i need to do, put it in the archive and it will automatically run after the extraction. Even if not, it does give me a direction to go in.

Thanks again.

Link to comment
Share on other sites

  • 3 weeks later...

Ok, I did a little research a while back and chose WinRAR SFX as my option... This works well aside from 1 problem... "Windows cannot find "Filename.exe" on the "Run after extraction" section.

Here is the mess I have made

Installer 1 = Main SFX archive holding the other 2 installers (Run "Installer 2" after extraction)

Installer 2 = SFX Archive that installs to a specific directory (Run "installer 3" after extraction)

Installer 3 = SFX Archive that installs to a different directory and doesnt initialize another installer

Note: I can run each installer manually and it works, but I am hoping to get this in 1 package to install each component in the directory it needs to go in order (I still get the error on Installer 2 for installer 3, but it does install 2 correctly). After going through this for many hours tonight, it is definitely evident that the problem has to be in the "Run After Extraction" section.

When I run Installer one, it just pop an error after the installer 1 is run saying that windows cannot find Installer 2... or "Installer 2.exe", or "Installer 2". <-- this was the solution methods from all the googling i did and none of these worked.

;The comment below contains SFX script commands

Path=%ProgramFiles%\XXXX\YYYY\ZZZZ
SavePath
Setup="Installer 2.exe"
TempMode

Have tried many different combinations tonight and nothing worked... is it possible that it needs a path name? It is extracting to temp, so im not sure how to declare that...

Any suggestions would be very helpful right now.

Thanks

Well, it came down to writing a .bat that is flawless and puts everything where it needs to go... all 50 files in all 50 directories, but... it only works for some of them because evidently it must need elevated privileges that the SFX Advanced tab doesn't take into account? The only time this thing will work 100% is to manually extract the files out of the archive and run the .bat. Running the installer doesn't successfully copy all the needed files where they need to go. I tested the code in command prompt and had all successful copies, then ran the .bat and it installed everything fine. Executing the installed with the .bat as the run after extraction, does NOT work for some of the files. Ran the app as admin as well...

Any suggestions?

Edited by Locke2904
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...