Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

QuickPatch Projekt


8 replies to this topic

bernard

bernard
  • Full Members
  • 127 posts

Posted 28 January 2011 - 12:19

Habe InstallShield 2011 - Professional Edition (Version 17)

Habe Test PC mit
VirtualMachine -> XP HE (+SP3)
msiexec.exe zeigt Version: 3.01.4001.5512

Aus einem InstallScript (ohne MSI) Projekt führe ich aus:

msiexec /i "my_Product.msi" INSTALLDIR="C:\Ziel-Directory\" ApplicationUsers=OnlyCurrentUser USERNAME="<User>" /L*V "%Temp%\my_Product.log"

"my_Product.msi" ist mit Basic MSI Projekt erstellt.

Ich erstelle ein QuickPatch Projekt.
Original Setup Path setze ich auf "my_Product.msi"-File.

Patch Settings -> Files -> Files To Patch -> Patch Existing File
suche ein File und ersetze mit neuem.

Problem:
Wenn neues File gleiche Version wie altes hat, wird Update.exe dieses File nicht überschreiben.

In diesem Fall setze ich Häckchen in:
Updated File -> Overwrite Any Existing File.

Lösung:
Mit gleichen Einstellungen erstelle ich ein msp-File
und führe manual aus:
msiexec.exe /p "my_Product-Patch.msp" REINSTALL=ALL REINSTALLMODE=ecmus ARPSYSTEMCOMPONENT=1 /L*VX "%Temp%\my_Product-Patch.log"

Jetzt funktioniert alles richtig!
Was ist falsch bei mir?

Danke im Voraus


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 February 2011 - 12:23

Windows Installer geht streng nach Versionsnummern vor. Wenn sich die Dateiversion nicht geändert hat, muss die Datei auch nciht überschrieben werden, ist ja nicht neuer, denkt sich Windows Installer.
Es ist essentiell, die Versionierung tatsächlich zu verwenden. D.h. wenn es eine neue Version der Datei ist, dann muss die eine höhere Nummer haben.

bernard

bernard
  • Full Members
  • 127 posts

Posted 04 February 2011 - 12:29

Zuerst vielen Dank für gute Erklärung.

Wenn man Update.exe startet wird es ins %TEMP%\{guid} ausgepackt und PatchPackage.msp von da gestartet. Oder?

Verzeichnis von %TEMP%\{guid}
03.02.2011 22.492 0x0409.ini
03.02.2011 732.160 PatchPackage.msp
03.02.2011 5.080 Setup.INI
03.02.2011 622 _ISMSIDEL.INI

Im Setup.INI gibt es:
[Startup]
CmdLine=REINSTALL=ALL REINSTALLMODE=omus

1.
Trotzdem werden die Files mit Häckchen in:
Updated File -> Overwrite Any Existing File....
nicht überschrieben.

2.
Wenn man PatchPackage.msp (mit doppelklick) startet
habe ich gleiches Problem.

3.
nur mit:
cmd
msiexec.exe /p "my_Product-Patch.msp" REINSTALL=ALL REINSTALLMODE=ecmus ARPSYSTEMCOMPONENT=1 /L*VX "%Temp%\my_Product-Patch.log"

funktioniert es richtig!

Ist es ein Fehler in InstallShield -> QuickPatch?


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 05 February 2011 - 18:54

Schreib doch mal eine Logdatei von der Update-Installation. Da sollte drin stehen, warum Windows Installer die Datei nicht überschreibt.

bernard

bernard
  • Full Members
  • 127 posts

Posted 08 February 2011 - 11:48

Danke Stefan für den Tipp.
------------------------
<mein_DLL> ist neu compiliert.
Info aus dem QuickPatch Project:
1.
Original File Information ->
- Original 4.4.0.0
- New Version: 4.4.0.0
2.
Bei
Files To Patch -> Updated File -> Overwrite Any Existing File - Select...
ist Häckchen eingetragen.

3. führe aus
cmd
update.exe /V"/L*VX \"C:\DOKUME~1\<user>\LOKALE~1\Temp\<mein_Product>-patch.log\""
4.
Aus dem LOG-File:
=== Verbose logging started: 08.02.2011 10:59:22 Build type: SHIP UNICODE 3.01.4001.5512 Calling process: C:\WINDOWS\system32\MSIEXEC.EXE ===
******* Product: {B1DA6D31-A74F-40FB-8D12-CEBE2D4A2A15}
MSI © (5C:FC) [10:59:22:609]: Baseline: Patch {EEC856C2-57E4-49A7-8AC6-0EF4217F8229} modified <mein_DLL> with full-file update.
MSI © (5C:FC) [10:59:22:609]: Baseline: First patch for <mein_DLL>, saving native info.
MSI © (5C:FC) [10:59:22:609]: Baseline: <mein_DLL> version for baseline at patch Native: 4.4.0.0, 1031, 49152.
MSI © (5C:FC) [10:59:22:609]: Baseline: <mein_DLL> version for baseline at patch {EEC856C2-57E4-49A7-8AC6-0EF4217F8229}: 4.4.0.0, 1031, 49152.
MSI © (5C:FC) [10:59:22:671]: Native File: <mein_DLL> ValData: 4.4.0.0 1031 49152
MSI © (5C:FC) [10:59:22:671]: {EEC856C2-57E4-49A7-8AC6-0EF4217F8229} File: <mein_DLL> ValData: 4.4.0.0 1031 49152
MSI (s) (44:E0) [10:59:30:453]: Baseline: Patch {EEC856C2-57E4-49A7-8AC6-0EF4217F8229} modified <mein_DLL> with full-file update.
MSI (s) (44:E0) [10:59:30:453]: Baseline: First patch for <mein_DLL>, saving native info.
MSI (s) (44:E0) [10:59:30:453]: Baseline: <mein_DLL> version for baseline at patch Native: 4.4.0.0, 1031, 49152.
MSI (s) (44:E0) [10:59:30:453]: Baseline: <mein_DLL> version for baseline at patch {EEC856C2-57E4-49A7-8AC6-0EF4217F8229}: 4.4.0.0, 1031, 49152.
MSI (s) (44:E0) [10:59:30:453]: File = <mein_DLL>: Final State = Install
MSI (s) (44:E0) [10:59:30:484]: Native File: <mein_DLL> ValData: 4.4.0.0 1031 49152
MSI (s) (44:E0) [10:59:30:484]: {EEC856C2-57E4-49A7-8AC6-0EF4217F8229} File: <mein_DLL> ValData: 4.4.0.0 1031 49152
MSI (s) (44:E0) [10:59:30:531]: Component: __Basis_Common_DLL_<mein_DLL>65; Installed: Null; Request: Local; Action: Local
MSI (s) (44:E0) [10:59:30:531]: Component: Basis_Common_DLL_<mein_DLL>; Installed: Local; Request: Local; Action: Local
MSI (s) (44:E0) [10:59:30:656]: File = <mein_DLL>: Final State = Install
MSI (s) (44:E0) [10:59:30:671]: The file represented by File table key '<mein_DLL>' has no eligible binary patches
MSI (s) (44:E0) [10:59:30:953]: Baseline: <mein_DLL> not touched in this transaction, verification required.
MSI (s) (44:E0) [10:59:30:953]: Baseline: Existing file <mein_DLL> matches baseline from patch Native.
MSI (s) (44:E0) [10:59:30:953]: Caching <mein_DLL> from C:\test5_work\common\<mein_DLL> for baseline 0
MSI (s) (44:E0) [10:59:31:750]: Executing op: ComponentRegister(ComponentId={0DE6C423-76E2-4EEC-8BD7-CCDF34BA3CF1},KeyPath=C:\test5_work\common\<mein_DLL>,State=3,,Disk=1,SharedDllRefCount=0,BinaryType=0)
1: {B1DA6D31-A74F-40FB-8D12-CEBE2D4A2A15} 2: {0DE6C423-76E2-4EEC-8BD7-CCDF34BA3CF1} 3: C:\test5_work\common\<mein_DLL>
MSI (s) (44:E0) [10:59:31:828]: Executing op: CacheBaselineFile(Baseline=0,FileKey=<mein_DLL>,FilePath=C:\test5_work\common\<mein_DLL>,,Existing=1)
MSI (s) (44:E0) [10:59:31:828]: Note: 1: 2318 2: C:\WINDOWS\Installer\$PatchCache$\UnManaged\S-1-5-21-329068152-839522115-682003330-1004\13D6AD1BF47ABF04D821ECEBD2A4A251\4.4.0\<mein_DLL>
MSI (s) (44:E0) [10:59:31:828]: Executing op: FileCopy(SourceName=<mein_DLL>,SourceCabKey=<mein_DLL>,DestName=<mein_DLL>,Attributes=20480,FileSize=49152,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,Version=4.4.0.0,Language=1031,InstallMode=58982400,,,,,,,)
MSI (s) (44:E0) [10:59:31:828]: File: C:\test5_work\common\<mein_DLL>; Won't Overwrite; Won't patch; Existing file is of an equal version
...
=== Logging stopped: 08.02.2011 10:59:34 ===
MSI © (5C:FC) [10:59:34:671]: Product: <mein_Product> - Update '<mein_Product> Patch 02042011' installed successfully.
MSI © (5C:FC) [10:59:34:671]: Note: 1: 1728
MSI © (5C:FC) [10:59:34:671]: Product: <mein_Product> -- Configuration completed successfully.
MSI © (5C:FC) [10:59:34:671]: Attempting to delete file C:\DOKUME~1\testa\LOKALE~1\Temp\5350db.msp
MSI © (5C:FC) [10:59:34:671]: Grabbed execution mutex.
MSI © (5C:FC) [10:59:34:671]: Cleaning up uninstalled install packages, if any exist
MSI © (5C:FC) [10:59:34:671]: MainEngineThread is returning 0
=== Verbose logging stopped: 08.02.2011 10:59:34 ===

Problem:
Wird das File "C:\test5_work\common\<mein_DLL>" nicht überschrieben!

Lösung:
update.exe /V"REINSTALL=ALL REINSTALLMODE=ecmus /L*VX \"C:\DOKUME~1\<user>\LOKALE~1\Temp\<mein_Product>-patch.log\""

So funktioniert richtig.
Aber möchte das Update.exe einfach starten.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 February 2011 - 17:50

Ich glaube diese Option bewirkt nur, dass die Datei komplett in den Patch übernommen wird, nicht nur die Binär-Differenz. Somit kann man damit jede (ältere) Version updaten. Sonst würde der Patch nur für genau die Version funktionieren, die mit dem ursprünglichen Setup ausgeliefert wurde. Insofern ist die Beschriftung "Overwrite any existing file" etwas zweideutig.

Etwas anderes ist die Option "Always Overwrite" bei den Properties der Datei. Ich nehme an, die war im ursprünglichen Setup nicht gewählt, oder? Diese Option führt dazu, dass InstallShield bezüglich der Versionsnummer lügt, d.h. in die File tabelle wird als Versionsnummer 65535.0.0.0 eingetragen, so dass Windows Instalelr immer denkt, die Datei sei neuer. Das ist aber ein nicht ganz sauberer "Hack".

Die korrekte Lösung ist, die Versionsnummer zu erhöhen. Alternativ bestünde die Möglichkeit, den REINSTALLMODE innerhalb des Setup zu setzen.

Bedenke aber, dass Windows Installer das Datum der Datei ignoriert, d.h. wenn's dumm läuft ersetzt er auch problemlos die neue 4.4.0.0 durch die alte 4.4.0.0. Und das merkt auch erstmal niemand, weil die Versionsnummern ja gleich sind. Also ich kann nur dringend empfehlen, die Versionsnummern dazu zu verwenden, wofür sie erfunden wurden. Alles andere ist immer eine Krücke!

bernard

bernard
  • Full Members
  • 127 posts

Posted 14 February 2011 - 12:21

QUOTE
Etwas anderes ist die Option "Always Overwrite" bei den Properties der Datei. Ich nehme an, die war im ursprünglichen Setup nicht gewählt, oder?

nicht gewählt.
QUOTE
Alternativ bestünde die Möglichkeit, den REINSTALLMODE innerhalb des Setup zu setzen.

Genau ist es mein Problem. Aber wie?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 February 2011 - 10:49

Hast du eine Custom Action von Typ 51 "Set a property" versucht?

bernard

bernard
  • Full Members
  • 127 posts

Posted 16 February 2011 - 09:35

Ich fand die Lösung:
1.
Wie im Buch
http://www.installsi...n/msi/books.htm
The Definitive Guide to Windows Installer
Author: Phil Wilson
Publisher: Apress
ISBN: 1-59059-297-2
300 pages, softcover

-> Applying the Patch
auf der Seite 222 beschrieben:
QUOTE

1. Create a Type 51 CA (call it SetReinstall) and set the Source value to be REINSTALL and the Target to be ALL.
If you know exactly which features are being updated, you could put the feature list in here instead of ALL.
2. Create a Type 51 CA (call it SetReinstallMode) and set the Source value to REINSTALLMODE and the Target to omus.
3. Insert these two CA into the InstallExecuteSequence before CostFinalize.
4. For the SetReinstallMode CA you should use a Condition value of
Installed AND PATCH AND NOT (REMOVE~="ALL").
This condition means that the REINSTALLMODE property is set only if the product
is already installed, a patch is being applied, and the product isn't being uninstalled.
5. For the SetReinstall CA, you should use the same condition, although you might
want to add an extra condition AND REINSTALL="". The reason for this is that the patch
might apply to several features, but you might want to use it to correct a specific client issue
with a single feature. So, you can name the feature with REINSTALL specification on a command-line install
and this CA condition won't override it.

2.
Habe zwei CA in meinem <mein_orig> (Basic MSI Project) erstellt:
- SetReinstall
Property Name REINSTALL
Propery Value ALL
Install Exec Sequence After IsolateComponents
Install Exec Condition Installed AND PATCH AND NOT (REMOVE~="ALL") AND REINSTALL=""

- SetReinstallMode
Property Name REINSTALLMODE
Propery Value emus
Install Exec Sequence After SetReinstall
Install Exec Condition Installed AND PATCH AND NOT (REMOVE~="ALL")
3.
Aus einem InstallScript (ohne MSI) Projekt führe ich aus:
msiexec.exe /i "<mein_orig>.msi" INSTALLDIR="C:\test5_work\" ARPSYSTEMCOMPONENT=1 /L*VX "%TEMP%\<mein_orig>.log"

aus dem <mein_orig>.log-File:
...
Action start 07:16:55: IsolateComponents.
MSI (s) (14:7C) [07:16:55:078]: Skipping action: SetReinstall (condition is false)
MSI (s) (14:7C) [07:16:55:078]: Skipping action: SetReinstallMode (condition is false)
MSI (s) (14:7C) [07:16:55:078]: Doing action: CostFinalize
Action ended 07:16:55: IsolateComponents. Return value 0.
...
Property(S): ReinstallModeText = emus

4.
Habe mit QuickPatch das Update.exe erstellt und so ausgeführt:
cmd
Update.exe /V"ARPSYSTEMCOMPONENT=1 /L*VX \"%TEMP%\<mein_orig>-patch.log\""

Aus dem <mein_orig>-patch.log:
...
Action 08:03:48: IsolateComponents.
Action start 08:03:48: IsolateComponents.
Action ended 08:03:48: IsolateComponents. Return value 0.
MSI (s) (D8:04) [08:03:48:270]: Skipping action: SetReinstall (condition is false)
MSI (s) (D8:04) [08:03:48:270]: Doing action: SetReinstallMode
Action 08:03:48: SetReinstallMode.
Action start 08:03:48: SetReinstallMode.
MSI (s) (D8:04) [08:03:48:270]: PROPERTY CHANGE: Modifying REINSTALLMODE property. Its current value is 'omus'. Its new value: 'emus'.
Action ended 08:03:48: SetReinstallMode. Return value 1.
MSI (s) (D8:04) [08:03:48:270]: Doing action: CostFinalize
Action 08:03:48: CostFinalize. Computing space requirements
Action start 08:03:48: CostFinalize.
...
Property(S): REINSTALLMODE = emus
Property(S): REINSTALL = meine_Feature-1,meine_Feature-2
...
=== Logging stopped: 16.02.2011 08:03:51 ===
MSI © (84:38) [08:03:51:114]: Product: <mein_orig> - Update '<mein_orig> Patch 02-16-2011' installed successfully.
MSI © (84:38) [08:03:51:129]: Note: 1: 1728
MSI © (84:38) [08:03:51:129]: Product: <mein_orig> -- Configuration completed successfully.

Wurden alle Files überschrieben!