SlideShare uma empresa Scribd logo
1 de 69
Einstieg in das Windows
Installer XML Toolset
(WiX)
Ralf Abramowitsch
ralf@abramowitsch.de | @minibrain81 | http://minibrain.wordpress.com
Die Software ist fertig …
… jetzt muss sie „nur“ noch ausgeliefert
werden.
Visual Studio Deployment Projects
gibt es in VS2012 leider nicht mehr …
Alternativen: Flexera InstallShield LE
Alternativen: Windows Installer XML
Toolset
• Seit 5.4.2004 OpenSource Projekt unter dem Dach
der Outercurve Foundation (www.wixtoolset.org)
• Lead: Rob Mensching (www.robmensching.com)
• C# basiertes Toolset zur Erstellung von MSI
Paketen aus XML-Beschreibungen
Alternativen: Windows Installer XML
Toolset
• Tools zum Kompilieren und Linken für MSI Pakete
• Burn: Bootstrapper und Chainer
• WiX SDK: Managed und Native Libraries
(z.B. für Custom Actions)
Alternativen: Windows Installer XML
Toolset
• Erweiterungen
• Installieren von IIS WebSites
• Erstellen von SQL-Server Datenbanken
• Ausnahmen für die Windows Firewall definieren
• Windows GameCenter nutzen
• …
Was brauche ich, um loszulegen?
• WiX Toolset Installer: http://wixtoolset.org/
• Aktuelle Version: 3.7
• Burn-basierter Installer: ~20MB
Kurzeinstieg in Windows
Installer
Grundlagen: Windows Installer und MSI Packages
Windows Installer Grundlagen
1010
Windows
Installer Client
Windows
Installer
Service
Windows
Installer
Package
Konzept eines Windows Installer
Package
11
Resource
Component
Feature
Product NotePad
Core
NotePad
Notepad.exe
UserReg
HKLM
Software
…
Docs
HelpDocs
HowTo.pdf
Konzept eines Windows Installer
Package
12
Resource
Component
Feature
Product NotePad
Core
NotePad
Notepad.exe
UserReg
HKLM
Software
…
Docs
HelpDocs
HowTo.pdf
Konzept eines Windows Installer
Package
13
Resource
Component
Feature
Product NotePad
Core
NotePad
Notepad.exe
UserReg
HKLM
Software
…
Docs
HelpDocs
HowTo.pdf
Konzept eines Windows Installer
Package
14
Resource
Component
Feature
Product NotePad
Core
NotePad
Notepad.exe
UserReg
HKLM
Software
…
Docs
HelpDocs
HowTo.pdf
Bekannte Dateiendungen
1515
Endung Abkürzung
.msi Managed Software Installation
.msm Managed Software Merge Module
.msp Managed Software Patch
.mst Managed Software Transformation
Windows Installer Features
• Installation On Demand
• Features können über die Windows Installer API hinzugefügt werden (von der
Anwendung getriggert)
Produkte können auf Anforderung installiert werden  Advertising
• Resource Stability
• „Vital Check“ für Komponenten
1616
Windows Installer Features
• Updates & Patches
• Major Upgrade
• Minor Upgrade
• Small Update
• Binary Delta Patches
1717
Windows Installer Features
• Transaktional
• Nur ein MSI-Paket kann zu einem Zeitpunkt ausgeführt werden
• Starten eine MSI aus einem anderen MSI nicht möglich (Chainer)
• Bootstrapper notwendig
(Systemvoraussetzungen prüfen und ggf. installieren)
• Rollback
• Wiederherstellen eines konsistenten Zustands im Fehlerfall
1818
Windows Installer Features
• Ausführliche Logging Features
• msiexec /i [msifile.msi] /l*v install.log
• Beispiel: install.log
1919
Windows Installer Features
• Verwendung von Systemwiederherstellungspunkten
2020
Windows Installer Features
• Verifizierbar durch Consistency Checkers
• ICE, internal consistency evaluators
• http://msdn.microsoft.com/en-
us/library/aa369554(VS.85).aspx
• Referenz der ICE Codes:
• http://msdn.microsoft.com/en-
us/library/aa369206.aspx
2121
Orca
• Viewer und Editor für MSI Pakete
• Bestandteil des Windows Installer SDK
2222
Windows Installer API
• Win32-basierte C-API (msi.h)
• Wrapper für C# in WiX-Toolkit verfügbar
• Hauptzweck: Product Management
• Installation, Deinstallation, Aufzählen von Produkten, Features und
Komponenten
2323
Erstellen von MSI Paketen mit
Windows Installer XML
Migration eines Visual Studio Deployment Projects zu einem WiX Projekt
WiX Tools im Überblick
• Candle
• Compiler für WiX Source Dateien (.wxs) in Intermediate Object Dateien (.wixobj)
• Light
• Linker und Binder für .wixobj nach .msi
• Lit
• Erzeugt WiX-Bibliotheken
• Dark
• MSI Decompiler (erzeugt aus .msi .wxs)
• Heat
• Harvester: erzeugt .wxs Dateien aus dem Dateisystem, der Registry, COM-DLLs, ..
WiX Tools im Überblick
• Melt
• Konvertiert ein “Merge Module” (.msm) in eine Component-Gruppe in einer .wxs-
Datei
• Torch
• Generiert die Transform-Datei für einen Patch
• Smoke
• Führt Validation Checks auf einem .MSI-Paket oder .MSM-Paket aus
• Pyro
• Erzeugt die Patch-Datei (.msp) aus .wixmsp und .wixmst Dateien
• WixCop
• Konvertiert WiX v2 Projekte in WiX v3 Projekte
Quelle: http://wix.sourceforge.net/manual-wix3/tools.htm
Wichtige WiX Kommandozeilen Tools
Setup.wxs Candle.exe Setup.wixobj Light.exe Setup.msi
Das WiX Element
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
</Wix>
Das Product Element
<Wix ...>
<Product Id="4E8049FC-4899-4A85-970F-61089FAA83A4"
Name="ExampleWixProject"
Language="1033"
Version="1.0.0.0"
Manufacturer="Ralf Abramowitsch"
UpgradeCode="DFFE1A72-E275-4A70-9BDC-5A6CCCA0C292">
</Product>
</Wix>
Product Code
Nur 3 Stellen werden ausgewertet
Identifiziert das Produkt über
Versionen hinweg
Das Package Element
<Wix ...>
<Product ...>
<Package Id='PUT-GUID-HERE'
Description='NotePadDNC13'
Manufacturer='Ralf Abramowitsch'
InstallerVersion='200'
Comments='A short description of the product.'
InstallScope='perMachine'
Compressed='yes'
InstallPrivileges='elevated'
Keywords='Installer,MSI,Database' />
</Product>
</Wix>
=msiexec.exe [MajorVersion] * 100 +
[MinorVersion]
Erzwingt Installation mit Admin-Rechten
(UAC)
Das Media Element
<Wix ...>
<Product ...>
<Package ... />
<Media Id="1"
Cabinet="contents.cab"
EmbedCab="yes"
CompressionLevel="high" />
</Product>
</Wix>
Disc-ID kann über File referenziert werden
Das Directory Element
<Wix ...>
<Product ...>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir"
Name="ExampleWixProject">
<Directory Id="ASubDir"
Name="MySubDir"/>
</Directory>
</Directory>
</Directory>
</Product>
</Wix>
Hierarchie muss mit TARGETDIR beginnen
Das Directory Element
Vordefiniertes Verzeichnis Beschreibung
AdminTools Verzeichnis zu dem Admin-Tools
AppDataFolder Anwendungsdaten des aktuellen Benutzers
CommonAppDataFolder Anwendungsdaten für alle Benutzer
CommonFilesFolder Pfad zu „Gemeinsame Dateien“
DesktopFolder Pfad zum Desktop des aktuellen Benutzers
FavoritesFolder Favoriten des aktuellen Benutzers
FontsFolder Windows Fonts-Verzeichnis
LocalAppDataFolder Lokale Anwendungsdaten des aktuellen Benutzers
MyPicturesFolder Bilder-Ordner
NetHoodFolder Netzwerkumgebung
PersonalFolder „Meine Dokumente“ des aktuellen Benutzers
PrintHoodFolder Drucker
Das Directory Element
Vordefiniertes Verzeichnis Beschreibung
ProgramFilesFolder Programme-Verzeichnis für 32-Bit-Programme
ProgramFiles64Folder .. und 64-Bit-Programme
ProgramMenuFolder Start-Menü: Programme
RecentFolder „Zuletzt geöffnete Dokumente“
SendToFolder „Senden An“ im Explorer
StartupFolder Start-Menü
StartMenuFolder Start-Menü-Ordner
SystemFolder C:WindowsSystem32 | C:WindowsSysWow64
System64Folder C:WindowsSystem32 auf x64-Systemen
TempFolder Temporäres Verzeichnis (%TEMP%)
TemplateFolder Vorlagen
WindowsFolder Windows-Ordner
Das Components Element
• Container für Dateien, Registry-Einträge, …
• Reference-Counting für Components in der Registry
• Component-Daten werden für Installation, Deinstallation und
Reparatur verwendet
Das Components Element
• Container für Dateien, Registry-Einträge, …
• Reference-Counting für Components in der Registry
• Component-Daten werden für Installation, Deinstallation und
Reparatur verwendet
Das Component Element
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="NotePadDnc13">
<Component Id="NotePadCoreBinaries"
Guid="80CE23D9-0CD4-42C3-A568-0DEA614C3B00">
<File Id="NotePadExe" Source="..BinariesReleaseNotePad.exe" />
</Component>
</Directory>
</Directory>
</Directory>
Das Feature Element
• Logische Gruppierung von Komponenten
• Feature-Baum
• Features können über Kommandozeile hinzugefügt werden
• msiexec /i notepaddnc13.msi ADDLOCAL=“MyFeature”
• msiexec /i notepaddnc13.msi ADDLOCAL=ALL
Das Feature Element
<Feature AllowAdvertise="no"
Id="MyFeature"
Title="NotepadDNC13"
Level="1"
Absent="disallow">
<ComponentRef Id="NotePadCoreBinaries" />
<ComponentRef Id="NotePadHelp" />
</Feature>
Demo
Der erste WiX Installer
Dialoge
Dialoge
• Verwendung von Dialogen aus der WiXUIExtension.dll
• Erstellen eigener Dialoge
Dialoge: WiXUIExtension.dll
WixUI_Mondo
WixUI_FeatureTree
WixUI_InstallDir
WixUI_Minimal
Kombinierter Welcome-
und License Dialog
Welcome
License
Destination Folder
Ready To Install
Welcome
License
Feature Selection
Ready To Install
Welcome
License
Setup Type (Typical /
Custom / Complete)
Feature Selection
Ready To Install
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_Mondo" />
Demo
Den ersten Installer um eine GUI erweitern.
Dialoge aus WiXUIExtension.dll
anpassen
• Austausch der Lizenzdatei durch eigene Lizenz im RTF-Format
• Austauschen der Bilder
• Anpassen der Texte in den Dialogen
• Anpassen der UI Sequence innerhalb der Dialog-Bibliothek
• Einfügen eigener Dialoge bei Verwendung der Dialog-Bibliothek
Demo
Anpassen der Dialoge aus der WiXUIExtension Bibliothek.
Dialoge: Eigene Dialoge erstellen
<UI>
<Dialog Id="MyDialog" Width="260" Height="85" Title="MyDialogTitle">
<Control Id="No" Type="PushButton" X="132" Y="57" Width="56" Height="17"
Default="yes" Cancel="yes" Text="No">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="Yes" Type="PushButton" X="72" Y="57" Width="56" Height="17" Text="yes">
<Publish Event="EndDialog" Value="Exit">1</Publish>
</Control>
<Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30"
NoPrefix="yes" Text="Do you really want to cancel?" />
</Dialog>
</UI>
Dialoge: Übersicht über verfügbare
Controls
• Billboard
• Bitmap
• CheckBox
• ComboBox
• DirectoryCombo
• DirectoryList
• Edit
• GroupBox
• Hyperlink
• Icon
• Line
• ListBox
• ListView
• MaskedEdit
• PathEdit
• ProgressBar
• PushButton
• RadioButtonGroup
• ScrollableText
• SelectionTree
• Text
• VolumeCostList
• VolumeSelectCombo
Demo
Erstellen eines neuen Dialogs.
Das Property Element
• Variablen werden über das Property-Element definiert
• Referenzieren von Properties über eckige Klammern
<Property Id="APPDATAPATH" Secure="yes"/>
<Condition Message="[ProductName] cannot be installed on this operating
system.">
Das Property Element
• Setzen von Property-Werten
• Über das Attribut „Value“
• Über das Text-Element
• Über Kommandozeilenargumente von msiexec
msiexec /i [mymsi.msi] APPDATAPATH=“D:”
<Property Id="APPDATAPATH" Secure="yes" Value="D:"/>
<Property Id="APPDATAPATH" Secure="yes">D:</Property >
Das Property Element
• Vordefinierte Windows Installer Properties
• Manufacturer
• ProductName
• ProductVersion
• UpgradeCode
• Installed
• Alle vordefinierten Verzeichnisse
• …
• siehe http://msdn.microsoft.com/en-us/library/aa370905%28v=VS.85%29.aspx
Das Property Element
• Spezial-Eigenschaften: ARP*
• ARPCONTACT: support@mycompany.com
• ARPURLUPDATEINFO: https://github.com/minibrain
• ARPHELPTELEPHONE: +49-(0)XXX-XXXX-XXX
• ARPINSTALLLOCATION: [INSTALLDIR]
• ARPCOMMENTS: NotePadDnc13 is installed in [INSTALLDIR].
• ARPHELPLINK: [HelpDir]Help.htm
Wie geht es weiter?
Zusätzliche Informationsquellen wie Bücher, Blogs, Links und Twitter Accounts.
Zusätzliche Informationsquellen
Windows Installer XML (WiX) Documentation
Sehr ausführliche und sehr gute Beschreibung
der Funktionalität.
Zusätzliche Informationsquellen
WiX 3.6: A Developer‘s Guide to Windows
Installer XML
von Nick Ramirez
http://www.packtpub.com/windows-installer-
xml-3-6-developers-guide/book
Zusätzliche Informationsquellen
Inside Windows Installer 4.5
„Erstellen und Verwalten von
Installationspaketen“
von Andreas Kerl
(leider nicht mehr verfügbar)
Zusätzliche Informationsquellen
The Definite Guide to Windows Installer
Technology
von Darwin Sanoy und Jeremy Moskowitz
http://eddiejackson.net/web_documents/The
_Definitive_Guide_to_Windows_Installer_Tech
nology.pdf
Zusätzliche Informationsquellen
WiX Tutorial von Gábor Deák Jahn
Umfangreiche Einführung in die WiX Installer
http://wix.tramontana.co.hu/
Zusätzliche Informationsquellen
Windows Installer Team Blog
mit nützlichen Tipps & Tricks rund im Windows
Installer und MSI
http://blogs.msdn.com/b/windows_installer_t
eam/
Zusätzliche Informationsquellen
Die offizielle WiX Projektseite
mit einer Übersicht über das Projekt und
hilfreichen Links. Erklärt auch einzelne WiX
Elemente.
http://wixtoolset.org/
Zusätzliche Informationsquellen
Die offizielle WiX Mailing List
Interessante Diskussionen, aber sehr
„geschwätzig“.
http://wix.sourceforge.net/mailinglists.html
Zusätzliche Informationsquellen @Twitter
Fragen?
Vielen Dank für Ihre
Aufmerksamheit
Tipps & Tricks: UI Designer
• WiXTrim (Open Source)
• http://sourceforge.net/projects/wixtrim/
• #develop (Open Source)
• http://icsharpcode.net
• WixEdit (Open Source)
• http://wixedit.sf.net
• WiXAware (kommerziell)
• http://www.wixaware.com/
• InStyler (kommerziell)
• http://www.instyler.com
Tipps & Tricks: Datei-Handling
• Dateien aus Verzeichnis einlesen
• Paraffin
• http://www.wintellect.com/CS/blogs/jrobbins/archive/tags/Paraffin/default.aspx
• https://github.com/Wintellect/Paraffin
• Heat
• Bestandteil des WiX Toolkits
Download Codebeispiele
Demo Codebeispiele können auf github heruntergeladen werden:
https://github.com/minibrain/DNC13/

Mais conteúdo relacionado

Destaque (20)

Paperless shop floor 01
Paperless shop floor 01Paperless shop floor 01
Paperless shop floor 01
 
Cloud Computing Tools
Cloud Computing ToolsCloud Computing Tools
Cloud Computing Tools
 
Beta management case
Beta management case Beta management case
Beta management case
 
Manual vacuum aspirator
Manual vacuum aspiratorManual vacuum aspirator
Manual vacuum aspirator
 
Types and parts of castle
Types and parts of castleTypes and parts of castle
Types and parts of castle
 
material handling equipment
material handling equipmentmaterial handling equipment
material handling equipment
 
Lean Software Development Principles
Lean Software Development PrinciplesLean Software Development Principles
Lean Software Development Principles
 
Spectrophotometer
SpectrophotometerSpectrophotometer
Spectrophotometer
 
Components of CT Scan Machine
Components of CT Scan MachineComponents of CT Scan Machine
Components of CT Scan Machine
 
QMS White Paper
QMS White PaperQMS White Paper
QMS White Paper
 
Suppy chain management of pharma
Suppy chain management of pharmaSuppy chain management of pharma
Suppy chain management of pharma
 
Web Application Performance
Web Application PerformanceWeb Application Performance
Web Application Performance
 
Agile test tools
Agile test toolsAgile test tools
Agile test tools
 
Best Practices for Managing SaaS Applications
Best Practices for Managing SaaS ApplicationsBest Practices for Managing SaaS Applications
Best Practices for Managing SaaS Applications
 
Shop Floor Planning & Control
Shop Floor Planning & ControlShop Floor Planning & Control
Shop Floor Planning & Control
 
Dimensions of metric hex nuts
Dimensions of metric hex nutsDimensions of metric hex nuts
Dimensions of metric hex nuts
 
Mobile Ecosystem
Mobile EcosystemMobile Ecosystem
Mobile Ecosystem
 
The Mobile Ecosystem
The Mobile EcosystemThe Mobile Ecosystem
The Mobile Ecosystem
 
Architecture of a Modern Web App
Architecture of a Modern Web AppArchitecture of a Modern Web App
Architecture of a Modern Web App
 
Thread fastener
Thread fastenerThread fastener
Thread fastener
 

Semelhante a Einstieg in das Windows Installer XML (WiX) ToolSet

Desktop Containers 12: Next Generation of ZENworks Application Virtualization
Desktop Containers 12: Next Generation of ZENworks Application VirtualizationDesktop Containers 12: Next Generation of ZENworks Application Virtualization
Desktop Containers 12: Next Generation of ZENworks Application VirtualizationGWAVA
 
Docker for Windows / Windows Container
Docker for Windows / Windows ContainerDocker for Windows / Windows Container
Docker for Windows / Windows ContainerThomas Wilhelm Wiefel
 
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Sebastian Huppmann
 
OSDC 2013 | Continuous Integration in data centers by Michael Prokop
OSDC 2013 | Continuous Integration in data centers by Michael ProkopOSDC 2013 | Continuous Integration in data centers by Michael Prokop
OSDC 2013 | Continuous Integration in data centers by Michael ProkopNETWAYS
 
Azure Bootcamp Hamburg
Azure Bootcamp Hamburg Azure Bootcamp Hamburg
Azure Bootcamp Hamburg Lennart Passig
 
Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...
Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...
Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...inovex GmbH
 
EntwicklerCamp 2014 - DOTS reloaded
EntwicklerCamp 2014 - DOTS reloadedEntwicklerCamp 2014 - DOTS reloaded
EntwicklerCamp 2014 - DOTS reloadedRené Winkelmeyer
 
OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...
OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...
OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...NETWAYS
 
Windows Azure Platform Overview
Windows Azure Platform   OverviewWindows Azure Platform   Overview
Windows Azure Platform OverviewOliver Michalski
 
Collaboration Days 2011 - Damit die Tester schneller ran können.
Collaboration Days 2011 - Damit die Tester schneller ran können.Collaboration Days 2011 - Damit die Tester schneller ran können.
Collaboration Days 2011 - Damit die Tester schneller ran können.David Schneider
 
OSMC 2014: Icinga Web 2 kann mehr | Thomas Gelf
OSMC 2014: Icinga Web 2 kann mehr | Thomas GelfOSMC 2014: Icinga Web 2 kann mehr | Thomas Gelf
OSMC 2014: Icinga Web 2 kann mehr | Thomas GelfNETWAYS
 
Azure für SysAdmins Eine Reise durch die Cloud v.0.5
Azure für SysAdmins   Eine Reise durch die Cloud v.0.5 Azure für SysAdmins   Eine Reise durch die Cloud v.0.5
Azure für SysAdmins Eine Reise durch die Cloud v.0.5 Oliver Michalski
 
Node.js - Von der Entwicklugn bis zum produktiven Einsatz
Node.js - Von der Entwicklugn bis zum produktiven EinsatzNode.js - Von der Entwicklugn bis zum produktiven Einsatz
Node.js - Von der Entwicklugn bis zum produktiven EinsatzKai Donato
 
OSMC 2014 | Icinga Web 2 kann mehr by Thomas Gelf
OSMC 2014 | Icinga Web 2 kann mehr by Thomas GelfOSMC 2014 | Icinga Web 2 kann mehr by Thomas Gelf
OSMC 2014 | Icinga Web 2 kann mehr by Thomas GelfNETWAYS
 
Boost your APEX Deployment and Provisioning with Docker
Boost your APEX Deployment and Provisioning with DockerBoost your APEX Deployment and Provisioning with Docker
Boost your APEX Deployment and Provisioning with DockerSteven Grzbielok
 
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Michael Kirst-Neshva
 
Herstellerunabhängige RZ Automatisierung mit orcharhino
Herstellerunabhängige RZ Automatisierung mit orcharhinoHerstellerunabhängige RZ Automatisierung mit orcharhino
Herstellerunabhängige RZ Automatisierung mit orcharhinoATIX AG
 
Icinga 2009 at Nagios Workshop
Icinga 2009 at Nagios WorkshopIcinga 2009 at Nagios Workshop
Icinga 2009 at Nagios WorkshopIcinga
 
Fanstatic pycon.de 2012
Fanstatic pycon.de 2012Fanstatic pycon.de 2012
Fanstatic pycon.de 2012Daniel Havlik
 

Semelhante a Einstieg in das Windows Installer XML (WiX) ToolSet (20)

Desktop Containers 12: Next Generation of ZENworks Application Virtualization
Desktop Containers 12: Next Generation of ZENworks Application VirtualizationDesktop Containers 12: Next Generation of ZENworks Application Virtualization
Desktop Containers 12: Next Generation of ZENworks Application Virtualization
 
Docker for Windows / Windows Container
Docker for Windows / Windows ContainerDocker for Windows / Windows Container
Docker for Windows / Windows Container
 
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
 
OSDC 2013 | Continuous Integration in data centers by Michael Prokop
OSDC 2013 | Continuous Integration in data centers by Michael ProkopOSDC 2013 | Continuous Integration in data centers by Michael Prokop
OSDC 2013 | Continuous Integration in data centers by Michael Prokop
 
Azure Bootcamp Hamburg
Azure Bootcamp Hamburg Azure Bootcamp Hamburg
Azure Bootcamp Hamburg
 
Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...
Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...
Continuous Delivery - Development Tool Chain - Virtualisierung, Packer, Vagra...
 
EntwicklerCamp 2014 - DOTS reloaded
EntwicklerCamp 2014 - DOTS reloadedEntwicklerCamp 2014 - DOTS reloaded
EntwicklerCamp 2014 - DOTS reloaded
 
OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...
OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...
OSMC 2017 | Windows Monitoring - Einrichtung und Prüfung mit Icinga2 by Chris...
 
Windows Azure Platform Overview
Windows Azure Platform   OverviewWindows Azure Platform   Overview
Windows Azure Platform Overview
 
Collaboration Days 2011 - Damit die Tester schneller ran können.
Collaboration Days 2011 - Damit die Tester schneller ran können.Collaboration Days 2011 - Damit die Tester schneller ran können.
Collaboration Days 2011 - Damit die Tester schneller ran können.
 
OSMC 2014: Icinga Web 2 kann mehr | Thomas Gelf
OSMC 2014: Icinga Web 2 kann mehr | Thomas GelfOSMC 2014: Icinga Web 2 kann mehr | Thomas Gelf
OSMC 2014: Icinga Web 2 kann mehr | Thomas Gelf
 
Azure für SysAdmins Eine Reise durch die Cloud v.0.5
Azure für SysAdmins   Eine Reise durch die Cloud v.0.5 Azure für SysAdmins   Eine Reise durch die Cloud v.0.5
Azure für SysAdmins Eine Reise durch die Cloud v.0.5
 
Node.js - Von der Entwicklugn bis zum produktiven Einsatz
Node.js - Von der Entwicklugn bis zum produktiven EinsatzNode.js - Von der Entwicklugn bis zum produktiven Einsatz
Node.js - Von der Entwicklugn bis zum produktiven Einsatz
 
OSMC 2014 | Icinga Web 2 kann mehr by Thomas Gelf
OSMC 2014 | Icinga Web 2 kann mehr by Thomas GelfOSMC 2014 | Icinga Web 2 kann mehr by Thomas Gelf
OSMC 2014 | Icinga Web 2 kann mehr by Thomas Gelf
 
Boost your APEX Deployment and Provisioning with Docker
Boost your APEX Deployment and Provisioning with DockerBoost your APEX Deployment and Provisioning with Docker
Boost your APEX Deployment and Provisioning with Docker
 
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
 
Roslyn DDC Kompakt 2014
Roslyn DDC Kompakt 2014Roslyn DDC Kompakt 2014
Roslyn DDC Kompakt 2014
 
Herstellerunabhängige RZ Automatisierung mit orcharhino
Herstellerunabhängige RZ Automatisierung mit orcharhinoHerstellerunabhängige RZ Automatisierung mit orcharhino
Herstellerunabhängige RZ Automatisierung mit orcharhino
 
Icinga 2009 at Nagios Workshop
Icinga 2009 at Nagios WorkshopIcinga 2009 at Nagios Workshop
Icinga 2009 at Nagios Workshop
 
Fanstatic pycon.de 2012
Fanstatic pycon.de 2012Fanstatic pycon.de 2012
Fanstatic pycon.de 2012
 

Einstieg in das Windows Installer XML (WiX) ToolSet

  • 1. Einstieg in das Windows Installer XML Toolset (WiX) Ralf Abramowitsch ralf@abramowitsch.de | @minibrain81 | http://minibrain.wordpress.com
  • 2. Die Software ist fertig … … jetzt muss sie „nur“ noch ausgeliefert werden.
  • 3. Visual Studio Deployment Projects gibt es in VS2012 leider nicht mehr …
  • 5. Alternativen: Windows Installer XML Toolset • Seit 5.4.2004 OpenSource Projekt unter dem Dach der Outercurve Foundation (www.wixtoolset.org) • Lead: Rob Mensching (www.robmensching.com) • C# basiertes Toolset zur Erstellung von MSI Paketen aus XML-Beschreibungen
  • 6. Alternativen: Windows Installer XML Toolset • Tools zum Kompilieren und Linken für MSI Pakete • Burn: Bootstrapper und Chainer • WiX SDK: Managed und Native Libraries (z.B. für Custom Actions)
  • 7. Alternativen: Windows Installer XML Toolset • Erweiterungen • Installieren von IIS WebSites • Erstellen von SQL-Server Datenbanken • Ausnahmen für die Windows Firewall definieren • Windows GameCenter nutzen • …
  • 8. Was brauche ich, um loszulegen? • WiX Toolset Installer: http://wixtoolset.org/ • Aktuelle Version: 3.7 • Burn-basierter Installer: ~20MB
  • 9. Kurzeinstieg in Windows Installer Grundlagen: Windows Installer und MSI Packages
  • 10. Windows Installer Grundlagen 1010 Windows Installer Client Windows Installer Service Windows Installer Package
  • 11. Konzept eines Windows Installer Package 11 Resource Component Feature Product NotePad Core NotePad Notepad.exe UserReg HKLM Software … Docs HelpDocs HowTo.pdf
  • 12. Konzept eines Windows Installer Package 12 Resource Component Feature Product NotePad Core NotePad Notepad.exe UserReg HKLM Software … Docs HelpDocs HowTo.pdf
  • 13. Konzept eines Windows Installer Package 13 Resource Component Feature Product NotePad Core NotePad Notepad.exe UserReg HKLM Software … Docs HelpDocs HowTo.pdf
  • 14. Konzept eines Windows Installer Package 14 Resource Component Feature Product NotePad Core NotePad Notepad.exe UserReg HKLM Software … Docs HelpDocs HowTo.pdf
  • 15. Bekannte Dateiendungen 1515 Endung Abkürzung .msi Managed Software Installation .msm Managed Software Merge Module .msp Managed Software Patch .mst Managed Software Transformation
  • 16. Windows Installer Features • Installation On Demand • Features können über die Windows Installer API hinzugefügt werden (von der Anwendung getriggert) Produkte können auf Anforderung installiert werden  Advertising • Resource Stability • „Vital Check“ für Komponenten 1616
  • 17. Windows Installer Features • Updates & Patches • Major Upgrade • Minor Upgrade • Small Update • Binary Delta Patches 1717
  • 18. Windows Installer Features • Transaktional • Nur ein MSI-Paket kann zu einem Zeitpunkt ausgeführt werden • Starten eine MSI aus einem anderen MSI nicht möglich (Chainer) • Bootstrapper notwendig (Systemvoraussetzungen prüfen und ggf. installieren) • Rollback • Wiederherstellen eines konsistenten Zustands im Fehlerfall 1818
  • 19. Windows Installer Features • Ausführliche Logging Features • msiexec /i [msifile.msi] /l*v install.log • Beispiel: install.log 1919
  • 20. Windows Installer Features • Verwendung von Systemwiederherstellungspunkten 2020
  • 21. Windows Installer Features • Verifizierbar durch Consistency Checkers • ICE, internal consistency evaluators • http://msdn.microsoft.com/en- us/library/aa369554(VS.85).aspx • Referenz der ICE Codes: • http://msdn.microsoft.com/en- us/library/aa369206.aspx 2121
  • 22. Orca • Viewer und Editor für MSI Pakete • Bestandteil des Windows Installer SDK 2222
  • 23. Windows Installer API • Win32-basierte C-API (msi.h) • Wrapper für C# in WiX-Toolkit verfügbar • Hauptzweck: Product Management • Installation, Deinstallation, Aufzählen von Produkten, Features und Komponenten 2323
  • 24. Erstellen von MSI Paketen mit Windows Installer XML Migration eines Visual Studio Deployment Projects zu einem WiX Projekt
  • 25. WiX Tools im Überblick • Candle • Compiler für WiX Source Dateien (.wxs) in Intermediate Object Dateien (.wixobj) • Light • Linker und Binder für .wixobj nach .msi • Lit • Erzeugt WiX-Bibliotheken • Dark • MSI Decompiler (erzeugt aus .msi .wxs) • Heat • Harvester: erzeugt .wxs Dateien aus dem Dateisystem, der Registry, COM-DLLs, ..
  • 26. WiX Tools im Überblick • Melt • Konvertiert ein “Merge Module” (.msm) in eine Component-Gruppe in einer .wxs- Datei • Torch • Generiert die Transform-Datei für einen Patch • Smoke • Führt Validation Checks auf einem .MSI-Paket oder .MSM-Paket aus • Pyro • Erzeugt die Patch-Datei (.msp) aus .wixmsp und .wixmst Dateien • WixCop • Konvertiert WiX v2 Projekte in WiX v3 Projekte
  • 28. Wichtige WiX Kommandozeilen Tools Setup.wxs Candle.exe Setup.wixobj Light.exe Setup.msi
  • 29. Das WiX Element <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> </Wix>
  • 30. Das Product Element <Wix ...> <Product Id="4E8049FC-4899-4A85-970F-61089FAA83A4" Name="ExampleWixProject" Language="1033" Version="1.0.0.0" Manufacturer="Ralf Abramowitsch" UpgradeCode="DFFE1A72-E275-4A70-9BDC-5A6CCCA0C292"> </Product> </Wix> Product Code Nur 3 Stellen werden ausgewertet Identifiziert das Produkt über Versionen hinweg
  • 31. Das Package Element <Wix ...> <Product ...> <Package Id='PUT-GUID-HERE' Description='NotePadDNC13' Manufacturer='Ralf Abramowitsch' InstallerVersion='200' Comments='A short description of the product.' InstallScope='perMachine' Compressed='yes' InstallPrivileges='elevated' Keywords='Installer,MSI,Database' /> </Product> </Wix> =msiexec.exe [MajorVersion] * 100 + [MinorVersion] Erzwingt Installation mit Admin-Rechten (UAC)
  • 32. Das Media Element <Wix ...> <Product ...> <Package ... /> <Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high" /> </Product> </Wix> Disc-ID kann über File referenziert werden
  • 33. Das Directory Element <Wix ...> <Product ...> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="MyProgramDir" Name="ExampleWixProject"> <Directory Id="ASubDir" Name="MySubDir"/> </Directory> </Directory> </Directory> </Product> </Wix> Hierarchie muss mit TARGETDIR beginnen
  • 34. Das Directory Element Vordefiniertes Verzeichnis Beschreibung AdminTools Verzeichnis zu dem Admin-Tools AppDataFolder Anwendungsdaten des aktuellen Benutzers CommonAppDataFolder Anwendungsdaten für alle Benutzer CommonFilesFolder Pfad zu „Gemeinsame Dateien“ DesktopFolder Pfad zum Desktop des aktuellen Benutzers FavoritesFolder Favoriten des aktuellen Benutzers FontsFolder Windows Fonts-Verzeichnis LocalAppDataFolder Lokale Anwendungsdaten des aktuellen Benutzers MyPicturesFolder Bilder-Ordner NetHoodFolder Netzwerkumgebung PersonalFolder „Meine Dokumente“ des aktuellen Benutzers PrintHoodFolder Drucker
  • 35. Das Directory Element Vordefiniertes Verzeichnis Beschreibung ProgramFilesFolder Programme-Verzeichnis für 32-Bit-Programme ProgramFiles64Folder .. und 64-Bit-Programme ProgramMenuFolder Start-Menü: Programme RecentFolder „Zuletzt geöffnete Dokumente“ SendToFolder „Senden An“ im Explorer StartupFolder Start-Menü StartMenuFolder Start-Menü-Ordner SystemFolder C:WindowsSystem32 | C:WindowsSysWow64 System64Folder C:WindowsSystem32 auf x64-Systemen TempFolder Temporäres Verzeichnis (%TEMP%) TemplateFolder Vorlagen WindowsFolder Windows-Ordner
  • 36. Das Components Element • Container für Dateien, Registry-Einträge, … • Reference-Counting für Components in der Registry • Component-Daten werden für Installation, Deinstallation und Reparatur verwendet
  • 37. Das Components Element • Container für Dateien, Registry-Einträge, … • Reference-Counting für Components in der Registry • Component-Daten werden für Installation, Deinstallation und Reparatur verwendet
  • 38. Das Component Element <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLLOCATION" Name="NotePadDnc13"> <Component Id="NotePadCoreBinaries" Guid="80CE23D9-0CD4-42C3-A568-0DEA614C3B00"> <File Id="NotePadExe" Source="..BinariesReleaseNotePad.exe" /> </Component> </Directory> </Directory> </Directory>
  • 39. Das Feature Element • Logische Gruppierung von Komponenten • Feature-Baum • Features können über Kommandozeile hinzugefügt werden • msiexec /i notepaddnc13.msi ADDLOCAL=“MyFeature” • msiexec /i notepaddnc13.msi ADDLOCAL=ALL
  • 40. Das Feature Element <Feature AllowAdvertise="no" Id="MyFeature" Title="NotepadDNC13" Level="1" Absent="disallow"> <ComponentRef Id="NotePadCoreBinaries" /> <ComponentRef Id="NotePadHelp" /> </Feature>
  • 41. Demo Der erste WiX Installer
  • 43. Dialoge • Verwendung von Dialogen aus der WiXUIExtension.dll • Erstellen eigener Dialoge
  • 44. Dialoge: WiXUIExtension.dll WixUI_Mondo WixUI_FeatureTree WixUI_InstallDir WixUI_Minimal Kombinierter Welcome- und License Dialog Welcome License Destination Folder Ready To Install Welcome License Feature Selection Ready To Install Welcome License Setup Type (Typical / Custom / Complete) Feature Selection Ready To Install <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" /> <UIRef Id="WixUI_Mondo" />
  • 45. Demo Den ersten Installer um eine GUI erweitern.
  • 46. Dialoge aus WiXUIExtension.dll anpassen • Austausch der Lizenzdatei durch eigene Lizenz im RTF-Format • Austauschen der Bilder • Anpassen der Texte in den Dialogen • Anpassen der UI Sequence innerhalb der Dialog-Bibliothek • Einfügen eigener Dialoge bei Verwendung der Dialog-Bibliothek
  • 47. Demo Anpassen der Dialoge aus der WiXUIExtension Bibliothek.
  • 48. Dialoge: Eigene Dialoge erstellen <UI> <Dialog Id="MyDialog" Width="260" Height="85" Title="MyDialogTitle"> <Control Id="No" Type="PushButton" X="132" Y="57" Width="56" Height="17" Default="yes" Cancel="yes" Text="No"> <Publish Event="EndDialog" Value="Return">1</Publish> </Control> <Control Id="Yes" Type="PushButton" X="72" Y="57" Width="56" Height="17" Text="yes"> <Publish Event="EndDialog" Value="Exit">1</Publish> </Control> <Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30" NoPrefix="yes" Text="Do you really want to cancel?" /> </Dialog> </UI>
  • 49. Dialoge: Übersicht über verfügbare Controls • Billboard • Bitmap • CheckBox • ComboBox • DirectoryCombo • DirectoryList • Edit • GroupBox • Hyperlink • Icon • Line • ListBox • ListView • MaskedEdit • PathEdit • ProgressBar • PushButton • RadioButtonGroup • ScrollableText • SelectionTree • Text • VolumeCostList • VolumeSelectCombo
  • 51. Das Property Element • Variablen werden über das Property-Element definiert • Referenzieren von Properties über eckige Klammern <Property Id="APPDATAPATH" Secure="yes"/> <Condition Message="[ProductName] cannot be installed on this operating system.">
  • 52. Das Property Element • Setzen von Property-Werten • Über das Attribut „Value“ • Über das Text-Element • Über Kommandozeilenargumente von msiexec msiexec /i [mymsi.msi] APPDATAPATH=“D:” <Property Id="APPDATAPATH" Secure="yes" Value="D:"/> <Property Id="APPDATAPATH" Secure="yes">D:</Property >
  • 53. Das Property Element • Vordefinierte Windows Installer Properties • Manufacturer • ProductName • ProductVersion • UpgradeCode • Installed • Alle vordefinierten Verzeichnisse • … • siehe http://msdn.microsoft.com/en-us/library/aa370905%28v=VS.85%29.aspx
  • 54. Das Property Element • Spezial-Eigenschaften: ARP* • ARPCONTACT: support@mycompany.com • ARPURLUPDATEINFO: https://github.com/minibrain • ARPHELPTELEPHONE: +49-(0)XXX-XXXX-XXX • ARPINSTALLLOCATION: [INSTALLDIR] • ARPCOMMENTS: NotePadDnc13 is installed in [INSTALLDIR]. • ARPHELPLINK: [HelpDir]Help.htm
  • 55. Wie geht es weiter? Zusätzliche Informationsquellen wie Bücher, Blogs, Links und Twitter Accounts.
  • 56. Zusätzliche Informationsquellen Windows Installer XML (WiX) Documentation Sehr ausführliche und sehr gute Beschreibung der Funktionalität.
  • 57. Zusätzliche Informationsquellen WiX 3.6: A Developer‘s Guide to Windows Installer XML von Nick Ramirez http://www.packtpub.com/windows-installer- xml-3-6-developers-guide/book
  • 58. Zusätzliche Informationsquellen Inside Windows Installer 4.5 „Erstellen und Verwalten von Installationspaketen“ von Andreas Kerl (leider nicht mehr verfügbar)
  • 59. Zusätzliche Informationsquellen The Definite Guide to Windows Installer Technology von Darwin Sanoy und Jeremy Moskowitz http://eddiejackson.net/web_documents/The _Definitive_Guide_to_Windows_Installer_Tech nology.pdf
  • 60. Zusätzliche Informationsquellen WiX Tutorial von Gábor Deák Jahn Umfangreiche Einführung in die WiX Installer http://wix.tramontana.co.hu/
  • 61. Zusätzliche Informationsquellen Windows Installer Team Blog mit nützlichen Tipps & Tricks rund im Windows Installer und MSI http://blogs.msdn.com/b/windows_installer_t eam/
  • 62. Zusätzliche Informationsquellen Die offizielle WiX Projektseite mit einer Übersicht über das Projekt und hilfreichen Links. Erklärt auch einzelne WiX Elemente. http://wixtoolset.org/
  • 63. Zusätzliche Informationsquellen Die offizielle WiX Mailing List Interessante Diskussionen, aber sehr „geschwätzig“. http://wix.sourceforge.net/mailinglists.html
  • 66. Vielen Dank für Ihre Aufmerksamheit
  • 67. Tipps & Tricks: UI Designer • WiXTrim (Open Source) • http://sourceforge.net/projects/wixtrim/ • #develop (Open Source) • http://icsharpcode.net • WixEdit (Open Source) • http://wixedit.sf.net • WiXAware (kommerziell) • http://www.wixaware.com/ • InStyler (kommerziell) • http://www.instyler.com
  • 68. Tipps & Tricks: Datei-Handling • Dateien aus Verzeichnis einlesen • Paraffin • http://www.wintellect.com/CS/blogs/jrobbins/archive/tags/Paraffin/default.aspx • https://github.com/Wintellect/Paraffin • Heat • Bestandteil des WiX Toolkits
  • 69. Download Codebeispiele Demo Codebeispiele können auf github heruntergeladen werden: https://github.com/minibrain/DNC13/