Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Perl script to change product code and product version in installshiled project (.ism) file?

by vitoco (Friar)
on Sep 23, 2009 at 13:48 UTC ( #796968=note: print w/ replies, xml ) Need Help??


in reply to Perl script to change product code and product version in installshiled project (.ism) file?

Use UUIDGEN to get those random unique guids on Win boxes.

sub newguid { local($id)=`uuidgen.exe` || die "$0: Cannot run UUIDGEN.EXE\n"; chomp($id); return $id; }


Comment on Re: Perl script to change product code and product version in installshiled project (.ism) file?
Download Code
Re^2: Perl script to change product code and product version in installshiled project (.ism) file?
by GrandFather (Cardinal) on Sep 23, 2009 at 22:57 UTC

    There are a pile of modules in CPAN for GUID generation (Win32::Guidgen, Win32API::GUID, Data::UUID, ...), although for product codes it's often useful to generate a GUID given the product name (and possibly version number). In Win32::MSI::HighLevel I do that using:

    use Digest::MD5 qw(md5_hex); sub genGUID { my $seed = shift; my $md5 = uc md5_hex ($seed); my @octets = $md5 =~ /(.{2})/g; substr $octets[6], 0, 1, '4'; # GUID Version 4 substr $octets[8], 0, 1, '8'; # draft-leach-uuids-guids-01.txt GUI +D variant my $GUID = "{@octets[0..3]-@octets[4..5]-@octets[6..7]-@octets[8.. +9]-@octets[10..15]}"; $GUID =~ s/ //g; return $GUID; }

    True laziness is hard work
      Hi I have written following code to read the data from .ism file. Similar way I will write a code to write data in .ism file but my code is failing with an error saying "Can't call method "OpenProject" on an undefined value at C:\Test\Update_ism.pl line 15." Following is the code. Can you please suggest how do I get rid of this.
      use Win32::Guidgen; use Win32::OLE; my $guid = Win32::Guidgen::generate(); #Generate GUID for Product code +. # instantiate the Developer Automation interface $dev = Win32::OLE->new("ISWiAutomation.ISWiProject"); # open a project file. $dev->OpenProject("C:\\InstallShield 2010 Projects\\Test.ism") or die +"Can not open project file:$!"; print "ProductName: " , $dev->ProductName, "\n", "ProductVersion: ", $dev->ProductVersion, "\n"; # close the project $dev->CloseProject( );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://796968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-08-30 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls