Look to the WinRAR help for information on commands and switches. ![]() Of course other options are available, both in the GUI and from the command line. The creation of such an SFX project can be automated from the command line. Private Sub BuildSFX(ByVal OutputPath As String, ByVal OutputFilename As String) Dim ExePath As String = "C:\Program Files\WinRAR\WinRAR.exe" Dim PathString As String = IO.Path.Combine(OutputPath, OutputFilename) Dim ScriptString As String = IO.Path.Combine(OutputPath, "script.txt") Dim ListString As String = IO.Path.Combine(OutputPath, "list.txt") Dim Options As String = String.Format("a """"", PathString, ListString, ScriptString) Options &= " -iicon""C:\Temp\Icons\AppIcon.ico""" Process.Start(ExePath, Options) End SubĬonclusion WinRAR gives you the ability to take an existing setup and deployment project that creates a setup.exe and an MSI file, and release a single file installer based on a self-extracting executable. In VB.NET I use code similar to this to automate this step: Note that the icon will be specified in the command line of the call to WinRAR. Title=My Application Silent=1 Overwrite=1 Setup=setup.exe Script.txt contains value pairs that configure some of the SFX options. Put one file line or use wildcards.Ĭ:\temp\New folder\setup.exe C:\temp\New folder\Setup.msi List.txt is a file containing the full filenames of the files to include in the self extractor. The VB.NET code I show later will refer to these files. I put them both in the output directory for my installer build process, so that folder contains: You can put these anywhere that is convenient. Fortunately, WinRAR lets us have the exact same functionality through the command line.Ĭreating the install file from the command line First let’s create two text files, script.txt and list.txt. You’ve created an automated build process for your installer-you don’t want to fiddle around with this GUI every time you rebuild. Well, this is all well and good, but with all these steps, it’s going to be impossible to keep doing this for every new release of your program. If there are no errors, WinRAR should now create your self extract file. This will make sure that the extract occurs without any additional intervention from the user.Ĭlick “Ok” on the bottom of the SFX options dialog, and “Ok” again for the “Add” dialog. On the Modes tab, check the “Hide all” option in silent mode. On the Update tab, ensure that “Overwrite all files” is checked. It makes a nice professional touch to use your icon instead of the default WinRAR icon. The icon is used to represent the self extract file itself in explorer. The text appears in the title bar when the extract is running. On the Text and Icon tab, you can edit the title of the self extract window and add an icon. ![]() This will launch your installer when the user runs the self extractor. On the General Tab, check “Create in the current folder” and add the option to run Setup.exe after extraction. This opens a dialog that allows you to change many of the default behaviours of the generated self extract files. Now you can edit the archive name, and check the “Create SFX” checkbox.Ĭlick the “SFX Options” button. Select the “Add to Archive…” context menu choice. Select the Setup.exe and your MSI file and right click. ![]() ![]() This might be adequate in some corporate environments, or for your friends, or for a group of developers, but otherwise Setup.exe bootstrapper should be included with your MSI file.Ĭreating the install file manually First of all, we’ll look at the steps involved to create the setup interactively. NET runtime requirements are present on the install target machine. You should only do this if you expect your end users to ensure all. This article explains how to do the latter, with WinRAR, producing a professional looking package.įirst of all, you may be tempted to just provide the MSI file for the installation. Introduction If you want to create a single file installer using Visual Studio, you can either use InstallShield LE, or repackage your setup.exe and MSI file into a self extracting file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |