Welcome to mirror list, hosted at ThFree Co, Russian Federation.

generator.pl « win « installer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5a90ec6bb56fa4cdc21bb5883ca8f90d8936b5e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
use strict;

my @RESOURCES = ("01_dejavusans.ttf", "02_droidsans-fallback.ttf", "03_jomolhari-id-a3d.ttf", "04_padauk.ttf", "05_khmeros.ttf", "06_code2000.ttf",
                 "basic.skn", "symbols_24.png",
                 "classificator.txt", "drawing_rules.bin",
                 "fonts_blacklist.txt", "fonts_whitelist.txt", "unicode_blocks.txt",
                 "languages.txt", "maps.update", "countries.txt", 
                 "welcome.html", "about-travelguide-desktop.html", "eula.html",
                 "dictionary.slf");

my @QT_LIBS = ("QtCore4.dll", "QtGui4.dll", "QtOpenGL4.dll", "QtNetwork4.dll", "QtWebkit4.dll");

my $QT_PATH = "..\\..\\..\\SDK\\Desktop\\Qt\\4.7.3\\msvc2010\\bin\\";
my $BINARY_PATH = "..\\..\\..\\omim-build-msvc2010\\out\\release\\";
my $DATA_PATH = "..\\..\\data\\";
my $MERGE_MODULE_PATH = "\\Program Files (x86)\\Common Files\\Merge Modules\\Microsoft_VC100_CRT_x86.msm";
my $MERGE_MODULE_TITLE = "Visual C++ 10.0 Runtime";

# read guids from file
my $GUIDS_FILE="guids.txt";
my %GUIDS;
open(IN, "<$GUIDS_FILE") or die "Couldn't open $GUIDS_FILE: $!";
while (<IN>)
{
  chomp;
  $_ =~ m/([0-9a-zA-Z-]*) (.*$)/;
  $GUIDS{$2} = $1;
}
close IN;

# generate mwm data file components list
sub GenComponents(\@$)
{
  my @files = @{(shift)};
  my $SOURCE_PATH = shift;
  my $COMPONENTS = "";
  my $REFS = "";
  foreach (@files)
  {
    $_ =~ /([a-zA-Z- _\.0-9]*)$/;
    my $nameOnly = $1;
    # fix id to be in valid wix format
    my $id = "_" . $nameOnly;
    $id =~ s/-/_/g;
    if (exists($GUIDS{$nameOnly}))
    {
      $COMPONENTS = $COMPONENTS . "             <Component Id='$id' Guid='$GUIDS{$nameOnly}'>\n" .
                                  "               <File Id='$id' Name='$nameOnly' Source='${SOURCE_PATH}$nameOnly' DiskId='1' KeyPath='yes' Checksum='no' />\n" .
                                  "             </Component>\n";
      $REFS = $REFS . "         <ComponentRef Id='$id' />\n";
    }
    else
    {
      # do nothing
      print "ERROR: missing file: $nameOnly\n";
    }
  }
  chomp($COMPONENTS);
  
  return ($COMPONENTS, $REFS);
}

my @files = <../../data/*.mwm>;
my @DATA_COMPONENTS = GenComponents(@files, $DATA_PATH);

my @RESOURCE_COMPONENTS = GenComponents(@RESOURCES, $DATA_PATH);

my @QT_COMPONENTS = GenComponents(@QT_LIBS, $QT_PATH);

print <<RAWTEXT;
<?xml version='1.0'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Id='42180640-750C-4d9e-9087-519705C069D5'
           Name='MapsWithMe'
           Language='1033'
           Version='1.0.0'
           Manufacturer='MapsWithMe'
           UpgradeCode='DFCB23C7-99B3-4228-93E5-625C48370982'>
    
    <Package Description='MapsWithMe - offline maps and travel guide'
             Comments='Supports Windows XP SP3 and above'
             Manufacturer='MapsWithMe'
             InstallerVersion='300'
             Compressed='yes'
             InstallPrivileges='elevated'
             InstallScope='perMachine'
             Platform='x86' />
 
      <Media Id='1' Cabinet='data.cab' EmbedCab='no' CompressionLevel='high' />

      <Directory Id='TARGETDIR' Name='SourceDir'>
        <Directory Id='ProgramFilesFolder' Name='PFiles'>
          <Directory Id='MapsWithMeDir' Name='MapsWithMe'>
            <Component Id='MapsWithMe.exe' Guid='67852405-8C7C-4ec4-81E7-698CE3CD9A67'>
              <File Id='MapsWithMe.exe' Name='MapsWithMe.exe' Source='${BINARY_PATH}MapsWithMe.exe' DiskId='1' KeyPath='yes' Checksum='yes' />
            </Component>
$QT_COMPONENTS[0]
            <Directory Id='MWMDataDir' Name='Data'>
$DATA_COMPONENTS[0]
$RESOURCE_COMPONENTS[0]
            </Directory>
          </Directory>
        </Directory>
      </Directory>
 
      <Feature Id='MapsWithMeFeature' Title='MapsWithMe' Level='1'>
         <ComponentRef Id='MapsWithMe.exe' />
$QT_COMPONENTS[1]
$DATA_COMPONENTS[1]
$RESOURCE_COMPONENTS[1]
      </Feature>
      
      <DirectoryRef Id='TARGETDIR'>
        <Merge Id='VCRedist' SourceFile='$MERGE_MODULE_PATH' DiskId='1' Language='0' FileCompression='Yes'/>
      </DirectoryRef>
      <Feature Id='VCRedist' Title='$MERGE_MODULE_TITLE' AllowAdvertise='no' Display='hidden' Level='1'>
        <MergeRef Id='VCRedist'/>
      </Feature>
      
   </Product>
</Wix>


RAWTEXT