问题描述:

I'm using WiX to make an MSI for my application, and I wrap that in an .exe with Innosetup.

When selecting repair from the add/remove programs list, I always get a Windows Installer prompt looking for the .msi in my TEMP folder, and obviously the .msi file isn't there breaking the repair. If I run the original installer .exe I can repair fine. Also running the bare MSI allows me the repair option too.

Is there something I'm missing in my MSI to properly cache the installer so repairs can be made?

UPDATE now with logging!

I'm no expert at WiX but I've figured out how to enable verbose logging and this is the log from when I perform a repair. I can see that it's looking in the temp directory first for the original MSI but obviously this isn't going to work... I just don't understand what I need to change to fix this:

=== Verbose logging started: 3/4/2014 10:01:40 Build type: SHIP UNICODE 5.00.7600.00 Calling process: C:\Windows\Explorer.EXE ===

MSI (c) (F0:10) [10:01:40:810]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (F0:10) [10:01:40:810]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (F0:D8) [10:01:40:857]: Resetting cached policy values

MSI (c) (F0:D8) [10:01:40:857]: Machine policy value 'Debug' is 0

MSI (c) (F0:D8) [10:01:40:857]: ******* RunEngine:

******* Product: {12152253-D5C3-4E75-9100-D53D7ED69262}

******* Action:

******* CommandLine: **********

MSI (c) (F0:D8) [10:01:40:857]: Client-side and UI is none or basic: Running entire install on the server.

MSI (c) (F0:D8) [10:01:40:857]: Grabbed execution mutex.

MSI (c) (F0:D8) [10:01:40:935]: Cloaking enabled.

MSI (c) (F0:D8) [10:01:40:935]: Attempting to enable all disabled privileges before calling Install on Server

MSI (c) (F0:D8) [10:01:40:935]: Incrementing counter to disable shutdown. Counter after increment: 0

MSI (s) (BC:54) [10:01:40:935]: Running installation inside multi-package transaction {12152253-D5C3-4E75-9100-D53D7ED69262}

MSI (s) (BC:54) [10:01:40:935]: Grabbed execution mutex.

MSI (s) (BC:28) [10:01:40:935]: Resetting cached policy values

MSI (s) (BC:28) [10:01:40:935]: Machine policy value 'Debug' is 0

MSI (s) (BC:28) [10:01:40:935]: ******* RunEngine:

******* Product: {12152253-D5C3-4E75-9100-D53D7ED69262}

******* Action:

******* CommandLine: **********

MSI (s) (BC:28) [10:01:40:935]: Machine policy value 'DisableUserInstalls' is 0

MSI (s) (BC:28) [10:01:40:935]: Setting cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: Attempting to recache package via ProductCode. Beginning source resolution.

MSI (s) (BC:28) [10:01:40:935]: User policy value 'SearchOrder' is 'nmu'

MSI (s) (BC:28) [10:01:40:935]: User policy value 'DisableMedia' is 0

MSI (s) (BC:28) [10:01:40:935]: Machine policy value 'AllowLockdownMedia' is 1

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Looking for sourcelist for product {12152253-D5C3-4E75-9100-D53D7ED69262}

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Adding {12152253-D5C3-4E75-9100-D53D7ED69262}; to potential sourcelist list (pcode;disk;relpath).

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Ignoring last used source.

MSI (s) (BC:28) [10:01:40:935]: Using cached product context: machine assigned for product: 352251213C5D57E419005DD3E76D2926

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Now checking product {12152253-D5C3-4E75-9100-D53D7ED69262}

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Processing net source list.

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Trying source C:\Users\qa\AppData\Local\Temp\is-5O84H.tmp\.

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 1402 2: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer 3: 2

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 2203 2: C:\Users\qa\AppData\Local\Temp\is-5O84H.tmp\softphone.msi 3: -2147287037

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 1706 2: -2147483647 3: softphone.msi

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Processing media source list.

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 2203 2: 3: -2147287037

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 1706 2: -2147483647 3: softphone.msi

MSI (s) (BC:28) [10:01:40:935]: SOURCEMGMT: Processing URL source list.

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 1402 2: UNKNOWN\URL 3: 2

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 1706 2: -2147483647 3: softphone.msi

MSI (s) (BC:28) [10:01:40:935]: Note: 1: 1706 2: 3: softphone.msi

MSI (c) (F0:10) [10:01:40:935]: User policy value 'SearchOrder' is 'nmu'

MSI (c) (F0:10) [10:01:40:935]: User policy value 'DisableMedia' is 0

MSI (c) (F0:10) [10:01:40:935]: Machine policy value 'AllowLockdownMedia' is 1

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Prompting user for a valid source.

MSI (c) (F0:10) [10:01:40:935]: Machine policy value 'DisableBrowse' is 0

MSI (c) (F0:10) [10:01:40:935]: Machine policy value 'AllowLockdownBrowse' is 0

MSI (c) (F0:10) [10:01:40:935]: Machine policy value 'DisableUserInstalls' is 0

MSI (c) (F0:10) [10:01:40:935]: Machine policy value 'DisableMsi' is 0

MSI (c) (F0:10) [10:01:40:935]: Machine policy value 'AlwaysInstallElevated' is 0

MSI (c) (F0:10) [10:01:40:935]: User policy value 'AlwaysInstallElevated' is 0

MSI (c) (F0:10) [10:01:40:935]: Product {12152253-D5C3-4E75-9100-D53D7ED69262} is admin assigned: LocalSystem owns the publish key.

MSI (c) (F0:10) [10:01:40:935]: Product {12152253-D5C3-4E75-9100-D53D7ED69262} is managed.

MSI (c) (F0:10) [10:01:40:935]: Running product '{12152253-D5C3-4E75-9100-D53D7ED69262}' with elevated privileges: Product is assigned.

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Browsing is enabled - but requires cred prompt.

MSI (c) (F0:10) [10:01:40:935]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Now checking product {12152253-D5C3-4E75-9100-D53D7ED69262}

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Attempting to use LastUsedSource from source list.

MSI (c) (F0:10) [10:01:40:935]: Note: 1: 1706 2: 3: softphone.msi

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Processing net source list.

MSI (c) (F0:10) [10:01:40:935]: Note: 1: 1706 2: -2147483647 3: softphone.msi

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Processing media source list.

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Trying media source ;.

MSI (c) (F0:10) [10:01:40:935]: Note: 1: 1706 2: 3: softphone.msi

MSI (c) (F0:10) [10:01:40:935]: SOURCEMGMT: Processing URL source liMSI (s) (BC:54) [10:01:46:357]: I/O on thread 2564 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:357]: I/O on thread 2556 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:357]: I/O on thread 500 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:357]: I/O on thread 1672 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:435]: I/O on thread 580 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:435]: I/O on thread 2272 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:435]: I/O on thread 1332 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:435]: I/O on thread 1756 could not be cancelled. Error: 1168

MSI (s) (BC:54) [10:01:46:435]: I/O on thread 296 could not be cancelled. Error: 1168

MSI (s) (BC:28) [10:01:46:435]: SOURCEMGMT: Failed to resolve source

MSI (s) (BC:28) [10:01:46:435]: MainEngineThread is returning 1612

st.

MSI (c) (F0:10) [10:01:40:935]: Note: 1: 1402 2: UNKNOWN\URL 3: 2

MSI (c) (F0:10) [10:01:40:935]: Note: 1: 1706 2: -2147483647 3: softphone.msi

MSI (c) (F0:10) [10:01:40:935]: Note: 1: 1706 2: 3: softphone.msi

MSI (c) (F0:2C) [10:01:44:372]: SOURCEMGMT: Trying source C:\Users\qa\AppData\Local\Temp\is-5O84H.tmp\.

MSI (c) (F0:2C) [10:01:44:372]: Note: 1: 2203 2: C:\Users\qa\AppData\Local\Temp\is-5O84H.tmp\softphone.msi 3: -2147287037

MSI (c) (F0:2C) [10:01:44:372]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.

MSI (c) (F0:2C) [10:01:44:372]: Note: 1: 1706 2: -2147483647 3: softphone.msi

MSI (c) (F0:2C) [10:01:44:372]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (s) (BC:54) [10:01:46:435]: User policy value 'DisableRollback' is 0

MSI (s) (BC:54) [10:01:46:435]: Machine policy value 'DisableRollback' is 0

MSI (s) (BC:54) [10:01:46:435]: Incrementing counter to disable shutdown. Counter after increment: 0

MSI (s) (BC:54) [10:01:46:435]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2

MSI (s) (BC:54) [10:01:46:435]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2

MSI (s) (BC:54) [10:01:46:435]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2

MSI (s) (BC:54) [10:01:46:435]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2

MSI (s) (BC:54) [10:01:46:435]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1

MSI (s) (BC:54) [10:01:46:435]: Restoring environment variables

MSI (c) (F0:D8) [10:01:46:482]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1

MSI (c) (F0:D8) [10:01:46:497]: MainEngineThread is returning 1612

=== Verbose logging stopped: 3/4/2014 10:01:46 ===

网友答案:

MSI caches the .msi but doesn't use it as a source for repair, so it prompts for a "real" source to reinstall files. (Before Windows 7, MSI would remove any embedded files from the cached copy of the .msi. Since Windows 7, it keeps them intact so as to not invalidate digital signatures but still doesn't use them as a source.) Burn, the WiX chainer, caches packages and registers the source with MSI so repair just works.

相关阅读:
Top