wix - Windows installer upgrade code generated from command line -
i using windows installer install/upgrade installation.
using visual studio can manually change version number , select yes when asked change productcode. creates installer capable of overwriting existing installation provided following properties set on installer project
removepreviousversions true detectnewerinstalledversion true
now in build server can change version number appropriate new version in .vdproj project.
can advise on how generate new productcode project command line or batch script?
the solution use uuidgen
uuidgen -c
will generate appropriate productcode.
the following batch script update product code , allow overwrite install when applied through build server prior performing release build.
rem rem batch file set release number , version number production release rem rem if not defined release_version exit /b 1 if not defined build_number exit /b 1 if not defined svn_revision exit /b 1 set sdkbin=%programfiles%\microsoft sdks\windows\v7.0a\bin if defined programfiles(x86) set sdkbin=%programfiles(x86)%\microsoft sdks\windows\v7.0a\bin rem change version details in windowsinstaller project fart windowsinstaller\windowsinstaller.vdproj "\"productversion\" = \"8:1.0.0\"" "\"productversion\" = \"8:%release_version%.%build_number%\"" if %errorlevel%==0 exit /b 1 /f %%i in ('"%sdkbin%\uuidgen" -c') set productcode=%%i if not defined productcode exit /b 2 fart windowsinstaller\windowsinstaller.vdproj "\"productcode\" = \"8:{2dd6303f-bf0c-4cd5-9aac-171c577ffead}\"" "\"productcode\" = \"8:{%productcode%}\"" if %errorlevel%==0 exit /b 1 exit /b 0
i use fart perform regex replacement in source file.
Comments
Post a Comment