Friday, October 24, 2014 Register   Login

This site uses DNS Made Easy. Use it for reliable and professional DNS services.

RSS Feeds
Blog

Inno Setup

Jan
27
 1884 Views ::  1 Comments RSS comment feed

I got tired of having to hand-copy file paths into the InnoSetup script for PainlessSVN. I'm specifically referring to the Subversion server files. There's something like 278 files, that are in nested folders. I had just finished pasting in all the paths for Subversion 1.6.13, when 1.6.15 was released and I was seriously dreading repeating this whole excersise again.

I needed something that would recurse through both files and folders. It's easy doing one or the other, but not both at the same time (at least for me). I spent about 3 hours last night working on this. The good thing about this code is that I needed something similar for the new DeleteDevCrumbs utility that I'm polishing for release.

As it currently stands, this code will create a list of files from the directory that is passed in through a command-line argument, scan the child directories, and create a text file for you. The file will contain a ready made list that can be pasted right in the [Files] section of an InnoSetup script.

Here's a console app with this code: 

using System.Collections.Generic;
using System.IO;

namespace ScanFilesTest {     class Program     {         private static List<string>  _tree = new List<string>();         static void Main(string[] args)         {             string rootDirectory = args[0];             var rootInfo = new DirectoryInfo(rootDirectory);             if (!rootInfo.Exists)             {                 throw new DirectoryNotFoundException(string.Format("{0} does not exist!", rootInfo.FullName));             }             FileInfo[] files = rootInfo.GetFiles();             if (files.Length > 0)             {                 ScanFolders(files);             }             else             {                 DirectoryInfo[] folders = rootInfo.GetDirectories();                 ScanFolders(folders);             }             TextWriter subversionList = new StreamWriter("D:\\subversionfilelist.txt");             foreach (var file in _tree)             {                 var currInfo = new FileInfo(file);                 string currDir = currInfo.FullName.Replace(rootDirectory, string.Empty);                 subversionList.WriteLine(string.Format("Source: {0}; DestDir: {{pf}}\\Subversion{1}; Components: Subversion", file, currDir));                 subversionList.Flush();             }             subversionList.Close();         }         private static void ScanFolders(FileInfo[] files)         {             foreach (var file in files)             {                 if (file != null && !string.IsNullOrEmpty(file.FullName))                 {                     _tree.Add(file.FullName);                  }             }             if (files.Length > 0)             {                 string root = files[0].DirectoryName;                 var rootInfo = new DirectoryInfo(root);                 DirectoryInfo[] folders = rootInfo.GetDirectories();                 if (folders.Length > 0)                 {                     ScanFolders(folders);                  }              }         }         private static void ScanFolders(IEnumerable<DirectoryInfo> folders)         {             foreach (var folder in folders)             {                 if (folder.GetFiles().Length > 0)                 {                     ScanFolders(folder.GetFiles());                 }                 else                 {                     if (folder.GetDirectories().Length > 0)                     {                         ScanFolders(folder.GetDirectories());                     }                     else                     {                         if (folder != null && !string.IsNullOrEmpty(folder.FullName))                         {                             _tree.Add(folder.FullName);                         }                     }                 }             }         }     } }

posted @ Thursday, January 27, 2011 10:18 AM by Hector Sosa, Jr

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Aug
28
 2997 Views ::  1 Comments RSS comment feed

That was easy!This has got to be the easiest thing I've ever done with Inno Setup!

I was looking for how to show the license/EULA text right at the beginning of the install process. Here's all you need to add to your Inno Setup script:

[Setup]
LicenseFile=PathToYourLicenseFile

WOW! That was easy!

posted @ Thursday, August 28, 2008 8:19 PM by Hector Sosa, Jr

Posted in: Inno Setup

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Aug
11

Here's a list of the tools that I use for both programming and maintaining my website:

Programming

.NET Libraries

Intallation

Databases

  • SQL Server 2000
  • SQL Server 2005 Express Edition
  • SQL Server 2005 Compact Edition
  • SQLite - http://www.sqlite.org

Graphics

Website

System Administration

Project Management

These tools are the ones I want to use, but for lack of funds, time, or knowledge, I haven't been able to incorporate into my practices:

I'm just amazed at the sheer number of programs that I'm using. I'm pretty sure I left out some, since I did this from memory. A couple of these are just way too expensive at this time. I'm  hoping to purchase them with the proceeds of the sales from the first version of PainlessSVN. This is one of the few disadvantages of growning a company organically.

I have been making a habit to purchase applications and apps from microISVs. I also check the Business of Software forums and Larkware News for other microISVs for tools that could make my life easier.

posted @ Saturday, August 11, 2007 7:39 PM by Hector Sosa, Jr

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Aug
02
 13454 Views ::  7 Comments RSS comment feed

I had a few people that asked me to explain how to detect and download the .NET 2.0 framework. I got started with a snippet from a guy with Stucko as his handle on the Joel On Software forums. I tweaked it, added more code, until I got it working pretty good.


I'm giving the community an Inno Setup script that all it does is detect, download, and install .NET 2.0 if it doesn't find it. You will need to get Download DLL from http://www.istool.org/default.aspx/isx/isxdl, then change the path to isxdl.dll under the [Files] section. Read more to see the code to do this, or download the zip file.










DotNet2Install.zip


  


Just giving back to the community that has helped me so much...

posted @ Thursday, August 02, 2007 5:25 PM by Hector Sosa, Jr

Posted in: Inno Setup

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Apr
03

I just downloaded all the latest bits for InnoSetup tonight. I want to have an install for Beta 1 as soon as possible, so that I can start getting feedback from people. This should be an interesting challange. I'm excited that I found a download dll that allows installs to download missing bits. This should make it easier to get the needed Microsoft Management Console (MMC) 3.0 stuff onto customer's computers.

I now have all of my VMs ready to go. My main concern is getting this install to work with Vista's UAC. I admit that I have been one of those programmers that didn't pay much attention to Microsoft's best practices when it came to non-admin functionality. I have mostly worked with internal apps, except for the time when I was part of the team that built the first version of Franklin Covey's Plan Plus. I still have the retail box that was signed by all the people in the team.

It feels good to be back working on PainlessSVN!

posted @ Tuesday, April 03, 2007 11:30 PM by Hector Sosa, Jr

Posted in: Inno Setup

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
  
Terms Of Use | Privacy Statement | SystemWidgets
Copyright 2002-2014 by SystemWidgets
Google Analytics Alternative