Hi,
We are preparing to release the next version of our product, which will
completely remove all previous versions. However, before uninstalling we
want to back up all the configuration files for the user.  To accomplish
this I thought I'd just use cmd.exe and a simple 'for' command  to make a
copy of all the files.  Here is the magic:

<CustomAction Id="SetPathToCmd" Property="Cmd" Value="[SystemFolder]cmd.exe"
/>
<CustomAction Id="BackUpConfigFiles" Property="Cmd" ExeCommand="/q /e:on /c
&quot;for /r &quot;[INSTALLDIR]&quot; %f in (*.config) do ( echo f | xcopy
/q /y &quot;%f&quot; &quot;%f.bak&quot; )&quot;" />

<InstallExecuteSequence>
<Custom Action="SetPathToCmd" Sequence="100">NOT Cmd</Custom>
<Custom Action="BackUpConfigFiles" After="SetPathToCmd" />
</InstallExecuteSequence>

The custom action runs and successfully copies all the files, however the
install fails with minimal information shown below.  I thought I'd change
the /c (exit cmd when done) with /k (leave cmd open) to see what errors it
might have, but with /k there are no errors in the command window, and when
I close it the installer finishes successfully.  Also if I copy and paste
this into a command window everything runs fine as expected.  Any ideas on
what might be going wrong or how I can do this?

Thanks,

Shawn

MSI (s) (9C:D0) [01:34:16:479]: Doing action: BackUpConfigFiles
MSI (s) (9C:D0) [01:34:16:479]: Note: 1: 2205 2:  3: ActionText
Action start 1:34:16: BackUpConfigFiles.
MSI (s) (9C:D0) [01:34:17:229]: Note: 1: 1722 2: BackUpConfigFiles 3:
C:\WINDOWS\system32\cmd.exe 4: /q /e:on /c "for /r "C:\Program
Files\ShawnCo\BackUpConfigTest\" %f in (*.config) do ( echo f | xcopy /q /y
"%f" "%f.bak" )"
MSI (s) (9C:D0) [01:34:17:229]: Note: 1: 2205 2:  3: Error
MSI (s) (9C:D0) [01:34:17:229]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1722
MSI (c) (90:F0) [01:34:17:244]: Font created.  Charset: Req=0, Ret=0, Font:
Req=MS Shell Dlg, Ret=MS Shell Dlg
Error 1722. There is a problem with this Windows Installer package. A
program run as part of the setup did not finish as expected. Contact your
support personnel or package vendor.  Action BackUpConfigFiles, location:
C:\WINDOWS\system32\cmd.exe, command: /q /e:on /c "for /r "C:\Program
Files\Xerox\XPIM 2.0\" %f in (*.config) do ( echo f | xcopy /q /y "%f"
"%f.bak" )"
MSI (s) (9C:D0) [01:34:18:745]: Note: 1: 2205 2:  3: Error
MSI (s) (9C:D0) [01:34:18:745]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (9C:D0) [01:34:18:745]: Product: BackUpConfigTest -- Error 1722.
There is a problem with this Windows Installer package. A program run as
part of the setup did not finish as expected. Contact your support personnel
or package vendor.  Action BackUpConfigFiles, location:
C:\WINDOWS\system32\cmd.exe, command: /q /e:on /c "for /r "C:\Program
Files\Xerox\XPIM 2.0\" %f in (*.config) do ( echo f | xcopy /q /y "%f"
"%f.bak" )"

Action ended 1:34:18: BackUpConfigFiles. Return value 3.
Action ended 1:34:18: INSTALL. Return value 3.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to