Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > Setup Factory 6.0

 
 
Thread Tools Display Modes
  #1  
Old 11-30-2001
nancyp nancyp is offline
Indigo Rose Customer
 
Join Date: May 2001
Posts: 21
Action Commands-WHILE File search and UNZIP

I have a folder that contains a large number of .zip files.

Can I build an action loop with WHILE or IF that will do the following:

Find a zip file (example: called goodfile.zip)
Create a folder called goodfile if it does not exist.
Extract contents of goodfile.zip to this folder called: goodfile
delete goodfile.zip

Now look for the next file with a .zip extention and repeat this until all the .zip files have been extracted.

Thanks to anyone for some help on this.

Currently the zip file does not have the recursive folder name but I could change that if necessary.
  #2  
Old 11-30-2001
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Re: Action Commands-WHILE File search and UNZIP

Hi,

Yes this is possible, what you would do is use a "Search For Files" action. Now, a "Search For Files" action will return a comma-delimited list of all items that match your search query.

You would then parse this list for the number of entries; the number of entries will control how many times you loop. Then parse through the search result, stripping one path off at a time. Now with our string actions you will be able to drop the .ZIP extension and the rest of the path. Then use an "UnZip Files" action to unzip the files.

Here is some pseudo-code:

Code:
Search For File (*.ZIP)
Count Delimited Strings (Store in %NumberOfDelimitedStrings%)
Assign Value (%Counter% = 0)
While (%Counter% < %NumberOfDelimitedStrings%)
   Get Delimited String (At %Counter%, Store in: %DelString%)
   Find String (Find “\”, In %DelString%, Search: Backward, Store in: %SlashPos%)
   RightString (Starting at: %SlashPos%, In: %DelString%, Store in: %FolderName%)
   Length of String (In: %FolderName%, Store In: %Length%)
   Assign Value (%Length% = %Length% - 3)
   LeftString (Starting at: %Length, In: %FolderName%, Store in: %FolderName%)
   UnZip Files (Zip File: %DelString%, UnZip to: %AppDir%\%FolderName%)
   Assign Value (%Counter% = %Counter% + 1)
End While
That is a very brief description of what you need to do, try it out. If you have troubles, post how far you got and I will try to point you in the right direction.

mark.

[This message has been edited by Mark (edited 11-30-2001).]

[This message has been edited by Mark (edited 11-30-2001).]
__________________
MSI Factory The Next Generation Intelligent Setup Builder
  #3  
Old 12-03-2001
nancyp nancyp is offline
Indigo Rose Customer
 
Join Date: May 2001
Posts: 21
Re: Action Commands-WHILE File search and UNZIP

Thank you for the help. I think I almost have it but it is not quite right and I need some help.

%AppDir%=d:\md

The zips are in %AppDir%\zips
Sample name: mosaddr.zip
Sample name: mosmenNT.zip

I understood your pseudo-code.

I am pretty close. It is extracting all the files into %AppDir%\filepro

It should be extracting into %AppDir%\filepro
%FolderName%.

The unzip fails on the first %FolderName% that does not exist and it should create.

How can I send you the actions so you can see it? I am unable to paste to this board from Setup Factory actions. I did export the code but of course attachments are not allowed.

Thank you for steering me in the right direction.

BTW - Is there a verbose or debug mode that would step thru the action, showing the variables or condition test results?
Nancy

 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 07:44 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software