Introduce msi localization, for now French and English available.

cusax-fix
Damian Minkov 16 years ago
parent d8c849924d
commit 3a6b5ad8e9

@ -668,7 +668,7 @@
overwrite="true"
filtering="yes">
<fileset dir="${inst.resrc}/windows">
<include name="en-us.wxl" />
<include name="*.wxl" />
<include name="installer-windows.wxs" />
<include name="SCRegistrySpec.wxi" />
<include name="windows_shortcut_specification.wxi" />
@ -717,6 +717,7 @@
dir="${windows.app.dir}/tmp"
failonerror="true">
<arg value="-nologo" />
<arg value="-dcodepage=1252" />
<arg value="-dPlatform=${candle.var.Platform}" />
<arg value="-ext" />
<arg value="WixUIExtension" />
@ -754,6 +755,41 @@
<arg value="${windows.app.dir}\tmp\setup.msi" />
<arg value="${windows.app.dir}\tmp\installer-windows.wixobj" />
</exec>
<!-- create transform files for the supported setup locales -->
<antcall target="build-installation-wix-locale">
<param name="locale.name" value="fr-fr"/>
<param name="locale.codepage" value="1252"/>
</antcall>
<!--antcall target="build-installation-wix-locale">
<property name="locale.name" value="bg-bg"/>
<property name="locale.codepage" value="1251"/>
</antcall-->
<!-- After we have created all transform files for all locales,
embed them into the setup msi one by one,
the last param is the LCID in order language to be
autoselected when msi is started
LCID info at:
http://msdn.microsoft.com/en-us/library/0h88fahh(v=vs.85).aspx
-->
<exec executable="cscript.exe"
dir="${light.dir}"
failonerror="true">
<arg value="${inst.resrc}\windows\WiSubStg.vbs" />
<arg value="${windows.app.dir}\tmp\setup.msi" />
<arg value="${windows.app.dir}\tmp\fr-fr.mst" />
<arg value="1036" />
</exec>
<!--exec executable="cscript.exe"
dir="${light.dir}"
failonerror="true">
<arg value="${inst.resrc}\windows\WiSubStg.vbs" />
<arg value="${windows.app.dir}\tmp\setup.msi" />
<arg value="${windows.app.dir}\tmp\bg-bg.mst" />
<arg value="1026" />
</exec-->
<!-- Bootstrap the MSI into an EXE -->
<!--copy
@ -808,6 +844,57 @@
<delete dir="${windows.app.dir}/tmp" />
</target>
<!-- Creates localized msi installers and the resulting
transform files-->
<target name="build-installation-wix-locale">
<!-- Execute candle.exe for locale.name-->
<exec
executable="${wix.home}\candle.exe"
dir="${windows.app.dir}/tmp"
failonerror="true">
<arg value="-nologo" />
<arg value="-dcodepage=${locale.codepage}" />
<arg value="-dPlatform=${candle.var.Platform}" />
<arg value="-ext" />
<arg value="WixUIExtension" />
<arg value="-ext" />
<arg value="WixUtilExtension" />
<arg value="-dSourceDir=light" />
<arg value="${candle.arg.var.JRESetup}" />
<arg value="installer-windows.wxs" />
</exec>
<!-- Execute light.exe for locale.name -->
<exec
executable="${wix.home}\light.exe"
dir="${light.dir}"
failonerror="true">
<arg value="-nologo" />
<arg value="-ext" />
<arg value="WixUIExtension" />
<arg value="-ext" />
<arg value="WixUtilExtension" />
<arg value="-cultures:${locale.name}" />
<arg value="-loc" />
<arg value="${windows.app.dir}\tmp\${locale.name}.wxl" />
<arg value="-out" />
<arg value="${windows.app.dir}\tmp\setup_${locale.name}.msi" />
<arg value="${windows.app.dir}\tmp\installer-windows.wixobj" />
</exec>
<exec
executable="${wix.home}\torch.exe"
dir="${light.dir}"
failonerror="true">
<arg value="-p" />
<arg value="-t" />
<arg value="language" />
<arg value="${windows.app.dir}\tmp\setup.msi" />
<arg value="${windows.app.dir}\tmp\setup_${locale.name}.msi" />
<arg value="-out" />
<arg value="${windows.app.dir}\tmp\${locale.name}.mst" />
</exec>
</target>
<!-- - - - - - - - - - - BUILDING RELEASE PACKAGES - - - - - - - - - - - -->
<!-- Internal target called by the "clean target" - removes the macosx-specific file -->
<!-- we only execute if at least one (in this case the first) of the links we are

@ -0,0 +1,101 @@
' Windows Installer utility to add a transform or nested database as a substorage
' For use with Windows Scripting Host, CScript.exe or WScript.exe
' Copyright (c) Microsoft Corporation. All rights reserved.
' Demonstrates the use of the database _Storages table
'
Option Explicit
Const msiOpenDatabaseModeReadOnly = 0
Const msiOpenDatabaseModeTransact = 1
Const msiOpenDatabaseModeCreate = 3
Const msiViewModifyInsert = 1
Const msiViewModifyUpdate = 2
Const msiViewModifyAssign = 3
Const msiViewModifyReplace = 4
Const msiViewModifyDelete = 6
Const ForAppending = 8
Const ForReading = 1
Const ForWriting = 2
Const TristateTrue = -1
' Check arg count, and display help if argument not present or contains ?
Dim argCount:argCount = Wscript.Arguments.Count
If argCount > 0 Then If InStr(1, Wscript.Arguments(0), "?", vbTextCompare) > 0 Then argCount = 0
If (argCount = 0) Then
Wscript.Echo "Windows Installer database substorage managment utility" &_
vbNewLine & " 1st argument is the path to MSI database (installer package)" &_
vbNewLine & " 2nd argument is the path to a transform or database to import" &_
vbNewLine & " If the 2nd argument is missing, substorages will be listed" &_
vbNewLine & " 3rd argument is optional, the name used for the substorage" &_
vbNewLine & " If the 3rd arugment is missing, the file name is used" &_
vbNewLine & " To remove a substorage, use /D or -D as the 2nd argument" &_
vbNewLine & " followed by the name of the substorage to remove" &_
vbNewLine &_
vbNewLine & "Copyright (C) Microsoft Corporation. All rights reserved."
Wscript.Quit 1
End If
' Connect to Windows Installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
' Evaluate command-line arguments and set open and update modes
Dim databasePath:databasePath = Wscript.Arguments(0)
Dim openMode : If argCount = 1 Then openMode = msiOpenDatabaseModeReadOnly Else openMode = msiOpenDatabaseModeTransact
Dim updateMode : If argCount > 1 Then updateMode = msiViewModifyAssign 'Either insert or replace existing row
Dim importPath : If argCount > 1 Then importPath = Wscript.Arguments(1)
Dim storageName : If argCount > 2 Then storageName = Wscript.Arguments(2)
If storageName = Empty And importPath <> Empty Then storageName = Right(importPath, Len(importPath) - InStrRev(importPath, "\",-1,vbTextCompare))
If UCase(importPath) = "/D" Or UCase(importPath) = "-D" Then updateMode = msiViewModifyDelete : importPath = Empty 'substorage will be deleted if no input data
' Open database and create a view on the _Storages table
Dim sqlQuery : Select Case updateMode
Case msiOpenDatabaseModeReadOnly: sqlQuery = "SELECT `Name` FROM _Storages"
Case msiViewModifyAssign: sqlQuery = "SELECT `Name`,`Data` FROM _Storages"
Case msiViewModifyDelete: sqlQuery = "SELECT `Name` FROM _Storages WHERE `Name` = ?"
End Select
Dim database : Set database = installer.OpenDatabase(databasePath, openMode) : CheckError
Dim view : Set view = database.OpenView(sqlQuery)
Dim record
If openMode = msiOpenDatabaseModeReadOnly Then 'If listing storages, simply fetch all records
Dim message, name
view.Execute : CheckError
Do
Set record = view.Fetch
If record Is Nothing Then Exit Do
name = record.StringData(1)
If message = Empty Then message = name Else message = message & vbNewLine & name
Loop
Wscript.Echo message
Else 'If adding a storage, insert a row, else if removing a storage, delete the row
Set record = installer.CreateRecord(2)
record.StringData(1) = storageName
view.Execute record : CheckError
If importPath <> Empty Then 'Insert storage - copy data into stream
record.SetStream 2, importPath : CheckError
Else 'Delete storage, fetch first to provide better error message if missing
Set record = view.Fetch
If record Is Nothing Then Wscript.Echo "Storage not present:", storageName : Wscript.Quit 2
End If
view.Modify updateMode, record : CheckError
database.Commit : CheckError
Set view = Nothing
Set database = Nothing
CheckError
End If
Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbNewLine & errRec.FormatText
End If
Wscript.Echo message
Wscript.Quit 2
End Sub

@ -12,7 +12,15 @@
<String Id="ShortcutsAndRegistryDlgDescription" Overridable="yes">Which additional tasks should be done?</String>
<String Id="ShortcutsAndRegistryDlgTitle" Overridable="yes">{\WixUI_Font_Title}Additional Tasks</String>
<String Id="ShortcutsAndRegistryDlg_CreateShortcuts" Overridable="yes">&amp;Create Shortcuts</String>
<String Id="ShortcutsAndRegistryDlg_CreateStartMenu" Overridable="yes">S&amp;tart Menu</String>
<String Id="ShortcutsAndRegistryDlg_CreateDesktop" Overridable="yes">&amp;Desktop</String>
<String Id="ShortcutsAndRegistryDlg_CreateAutoStart" Overridable="yes">&amp;Auto-start when computer restarts or reboots</String>
<String Id="ShortcutsAndRegistryDlg_AssociateProtocols" Overridable="yes">&amp;Associate Protocols</String>
<String Id="WelcomeText1" Overridable="yes"><![CDATA[@WelcomeText1@]]></String>
<String Id="WelcomeText2" Overridable="yes"><![CDATA[@WelcomeText2@]]></String>
<String Id="WelcomeText3" Overridable="yes">{\GreyText}@WelcomeText3@</String>
<String Id="ExitDialogOptionaCheckBoxText" Overridable="yes">Launch [ProductName]</String>
</WixLocalization>

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization
xmlns="http://schemas.microsoft.com/wix/2006/localization"
Culture="fr-fr" Codepage="1252">
<String Id="CleanSweepDlg_Title" Overridable="yes">Installation de [ProductName]</String>
<String Id="CleanSweepDlgBannerBitmap" Overridable="yes">WixUI_Bmp_Banner</String>
<String Id="CleanSweepDlgDescription" Overridable="yes">Quelles options souhaitez-vous ajouter?</String>
<String Id="CleanSweepDlgTitle" Overridable="yes">{\WixUI_Font_Title}Options supplémentaires</String>
<String Id="ShortcutsAndRegistryDlg_Title" Overridable="yes">Installation de [ProductName]</String>
<String Id="ShortcutsAndRegistryDlgBannerBitmap" Overridable="yes">WixUI_Bmp_Banner</String>
<String Id="ShortcutsAndRegistryDlgDescription" Overridable="yes">Quelles options souhaitez-vous ajouter?</String>
<String Id="ShortcutsAndRegistryDlgTitle" Overridable="yes">{\WixUI_Font_Title}Options supplémentaires</String>
<String Id="ShortcutsAndRegistryDlg_CreateShortcuts" Overridable="yes">&amp;Accès à [ProductName] :</String>
<String Id="ShortcutsAndRegistryDlg_CreateStartMenu" Overridable="yes">Placer un accès direct dans le Menu « Démarrer »</String>
<String Id="ShortcutsAndRegistryDlg_CreateDesktop" Overridable="yes">Placer un accès direct sur le Bureau</String>
<String Id="ShortcutsAndRegistryDlg_CreateAutoStart" Overridable="yes">Lancer automatiquement quand lordinateur démarre</String>
<String Id="ShortcutsAndRegistryDlg_AssociateProtocols" Overridable="yes">&amp;Protocoles associés</String>
<String Id="WelcomeText1" Overridable="yes"><![CDATA[Ce logiciel est developpé par la communauté de APP_NAME ]]></String>
<String Id="WelcomeText2" Overridable="yes"><![CDATA[Découvrir notre site : APP_WEB]]></String>
<String Id="WelcomeText3" Overridable="yes">/String>
<String Id="ExitDialogOptionaCheckBoxText" Overridable="yes">Launch [ProductName]</String>
</WixLocalization>

@ -10,21 +10,23 @@
<Product
Id="*"
Language="1033"
Codepage='$(var.codepage)'
Manufacturer="@APP_NAME@"
Name="@APP_NAME@"
UpgradeCode="@WIX_UPGRADE_CODE@"
Version="1.0.0.0">
<!-- in Language we list all languages we support for localize -->
<Package
Comments="@PKG_COMMENTS@"
Compressed="yes"
Description="@PKG_DESCRIPTION@"
InstallerVersion="200"
InstallScope="perMachine"
Languages="1033"
Languages="1033,1036"
Manufacturer="@APP_NAME@"
Platform="$(var.Platform)"
SummaryCodepage="1252" />
SummaryCodepage='$(var.codepage)' />
<Upgrade Id="@WIX_UPGRADE_CODE@">
<UpgradeVersion
@ -166,12 +168,12 @@
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="ShortcutGroup" Type="GroupBox" X="20" Y="60" Width="330" Height="65" Text="&amp;Create Shortcuts" />
<Control Id="StartMenuShortcutCheckBox" Type="CheckBox" X="25" Y="75" Width="320" Height="15" Property="CREATE_START_MENU_SHORTCUT" CheckBoxValue="1" Text="S&amp;tart Menu" />
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="25" Y="90" Width="320" Height="15" Property="CREATE_DESKTOP_SHORTCUT" CheckBoxValue="1" Text="&amp;Desktop" />
<Control Id="StartupShortcutCheckBox" Type="CheckBox" X="25" Y="105" Width="320" Height="15" Property="HAS_STARTUP_REGISTRY" CheckBoxValue="1" Text="&amp;Auto-start when computer restarts or reboots" />
<Control Id="ShortcutGroup" Type="GroupBox" X="20" Y="60" Width="330" Height="65" Text="!(loc.ShortcutsAndRegistryDlg_CreateShortcuts)" />
<Control Id="StartMenuShortcutCheckBox" Type="CheckBox" X="25" Y="75" Width="320" Height="15" Property="CREATE_START_MENU_SHORTCUT" CheckBoxValue="1" Text="!(loc.ShortcutsAndRegistryDlg_CreateStartMenu)" />
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="25" Y="90" Width="320" Height="15" Property="CREATE_DESKTOP_SHORTCUT" CheckBoxValue="1" Text="!(loc.ShortcutsAndRegistryDlg_CreateDesktop)" />
<Control Id="StartupShortcutCheckBox" Type="CheckBox" X="25" Y="105" Width="320" Height="15" Property="HAS_STARTUP_REGISTRY" CheckBoxValue="1" Text="!(loc.ShortcutsAndRegistryDlg_CreateAutoStart)" />
<Control Id="RegistryGroup" Type="GroupBox" X="20" Y="130" Width="330" Height="50" Text="&amp;Associate Protocols" />
<Control Id="RegistryGroup" Type="GroupBox" X="20" Y="130" Width="330" Height="50" Text="!(loc.ShortcutsAndRegistryDlg_AssociateProtocols)" />
<Control Id="SipRegistryEntriesCheckBox" Type="CheckBox" X="25" Y="145" Width="320" Height="15" Property="CREATE_SIP_REGISTRY_ENTRIES" CheckBoxValue="1" Text="&amp;SIP" />
<!--
The RSS plug-in has been removed from SIP Communicator so it no longer makes
@ -442,7 +444,7 @@
<Property Id="IS_AUTOUPDATE" Value="0" Hidden="yes" />
<Property Id="WixShellExecTarget" Value="[#run.exe]" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch @APP_NAME@" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.ExitDialogOptionaCheckBoxText)" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<?include windows_shortcut_specification.wxi ?>

Loading…
Cancel
Save