Masaki Suketa wrote:
> Hello,
> 
> Micke Micke wrote:
>>         msiInstaller = WIN32OLE.new('WindowsInstaller.Installer')
>>         else
>>             return 0
>>         end
>> end
> 
> I have not written script using WindowsInstaller, but I think:
> (1) msiInstaller should be created only at once if you could.
> (2) view.close() should be called before return from GetProperty.
>      (I can't find how to close db(Database) object.)
> 
> (1)
>    require 'win32ole'
>    class Installer
>      @@msiInstaller = nil
>      def self.create
>        if !@@msiInstaller
>           @@msiInstaller = WIN32OLE.new('WindowsInstaller.Installer')
>        end
>        @@msiInstaller
>      end
>    end
> 
>    def GetProperty(msiPath, property)
>      begin
>        msiInstaller = Installer.create
>          ...
> (2)
>           record = view.Fetch()
>           val = 0
>           if record != nil then
>               val = record.StringData(1)
>           else
>               val = 0
>           end
>           view.close
>           return val
> 
> Hope this helps.
>    Regards,
>    Masaki Suketa

Hi Masaki

I have tried the example above, unfortunately i get same result as 
before. The script eats allot of memory, and it will not receive all the 
msi-package information.

As i mention before, if I divide the msi-package-list in to, run the 
script to time, it works.

I have tried with the latest version of ruby, but it fails, this time it 
fails with more packages compare to 1.8 release of ruby.
I also tried to cut up the list in two arrays, and execute the 
msi-method two times, but i get same problem as above.

I tried to make a similar script in python, except i can't apply 
transform-files, it worked without any problem, and much less memory 
usage.
So i wonder if it is a problem in the win32ole.

Thanks for you help.

// Micke
-- 
Posted via http://www.ruby-forum.com/.