[Solved] Environment variables in create file

Topics: Enhancement Request
Dec 19, 2013 at 4:53 PM
I'm attempting to create a custom update with a step that creates a config file in %APPDATA%. Unfortunately it seems that CustomUpdateEngine doesn't expand the variable. Is there a syntax to make it expand or is this feature not present?
Coordinator
Dec 19, 2013 at 5:51 PM
Can you post the file : C:\Windows\Temp\CustomUpdateEngine.log
Dec 20, 2013 at 1:50 PM
I changed %APPDATA% to %ALLUSERSPROFILE% (which makes more sense) but I get the same result. The file gets created in "C:\Windows\SoftwareDistribution\Download\Install\%ALLUSERSPROFILE%" on Win7.

I'm also getting an MSI error (1619), but that's another issue...

12/20/2013 9:37:22 AM ========================================================================================================================
12/20/2013 9:37:22 AM Starting CustomUpdateEngine with ActionFile : af32ad23-cba3-4e95-8b69-2e698da68066.xml
12/20/2013 9:37:22 AM Starting parsing ActionFile.
12/20/2013 9:37:22 AM Get Element from : <Action>
<ElementType>CustomUpdateElements.VariableElement</ElementType>
<Name>InstallerCode</Name>
<Type>Int</Type>
<ID>4345b3d4-11e2-4ec3-95e7-c7cab8fb8d07</ID>
</Action>
12/20/2013 9:37:22 AM Get VariableElement from : <Action>
<ElementType>CustomUpdateElements.VariableElement</ElementType>
<Name>InstallerCode</Name>
<Type>Int</Type>
<ID>4345b3d4-11e2-4ec3-95e7-c7cab8fb8d07</ID>
</Action>
12/20/2013 9:37:22 AM Get Element from : <Action>
<ElementType>CustomUpdateElements.ExecutableElement</ElementType>
<PathToExecutable>TCClient_Install.exe</PathToExecutable>
<Parameters>/S /v/qn</Parameters>
<KillProcess>True</KillProcess>
<TimeBeforeKilling>10</TimeBeforeKilling>
<Variable>4345b3d4-11e2-4ec3-95e7-c7cab8fb8d07</Variable>
</Action>
12/20/2013 9:37:22 AM Get ExecutableElement from : <Action>
<ElementType>CustomUpdateElements.ExecutableElement</ElementType>
<PathToExecutable>TCClient_Install.exe</PathToExecutable>
<Parameters>/S /v/qn</Parameters>
<KillProcess>True</KillProcess>
<TimeBeforeKilling>10</TimeBeforeKilling>
<Variable>4345b3d4-11e2-4ec3-95e7-c7cab8fb8d07</Variable>
</Action>
12/20/2013 9:37:22 AM Instance ExecutableElement successful.
12/20/2013 9:37:22 AM Get Element from : <Action>
<ElementType>CustomUpdateElements.TextFileElement</ElementType>
<Filepath>%ALLUSERSPROFILE%\Hawkeye Technology\TimeClick</Filepath>
<Filename>TimeClickWS.ini</Filename>
<FileContent>[Session_Default]
Creation Order=0
Name=Default
Description=Auto-Created Default Session
Type=0
Force Buffer Flush=0
Keep Tables Open=0
Row Lock Protocol=1
Row Lock Retry Count=15
Row Lock Wait Time=100
Row Change Detection=0
Progress Interval=1000
Configuration In Memory=0
Configuration Name=TCDBConfig
Large File Support=0
Standard NULL Behavior=1
Maximum Log File Size=1048576
Log Information Events=1
Log Warning Events=1
Log Error Events=1
Catalog Name=TCDBDatabase
Configuration File Extension=.TCDBCfg
Lock Files Extension=.TCDBLck
Log File Extension=.TCDBLog
Backup Files Extension=.TCDBBkp
Update Files Extension=.TCDBUpd
Catalog Files Extension=.TCDBCat
Table Files Extension=.TCDBTbl
Table Index Files Extension=.TCDBIdx
Table BLOB Files Extension=.TCDBBlb
Table Publish Files Extension=.TCDBPbl
Remote Compression=0
Remote Host=XXX.X.X.X
Remote Address=192.1.1.4
Remote Port=12010
Remote Service=
Remote Encryption=0
Remote Timeout=180
Remote Ping=1
Remote Ping Interval=60
</FileContent>
<Variable />
</Action>
12/20/2013 9:37:22 AM Get TextFileElement from : <Action>
<ElementType>CustomUpdateElements.TextFileElement</ElementType>
<Filepath>%ALLUSERSPROFILE%\Hawkeye Technology\TimeClick</Filepath>
<Filename>TimeClickWS.ini</Filename>
<FileContent>[Session_Default]
Creation Order=0
Name=Default
Description=Auto-Created Default Session
Type=0
Force Buffer Flush=0
Keep Tables Open=0
Row Lock Protocol=1
Row Lock Retry Count=15
Row Lock Wait Time=100
Row Change Detection=0
Progress Interval=1000
Configuration In Memory=0
Configuration Name=TCDBConfig
Large File Support=0
Standard NULL Behavior=1
Maximum Log File Size=1048576
Log Information Events=1
Log Warning Events=1
Log Error Events=1
Catalog Name=TCDBDatabase
Configuration File Extension=.TCDBCfg
Lock Files Extension=.TCDBLck
Log File Extension=.TCDBLog
Backup Files Extension=.TCDBBkp
Update Files Extension=.TCDBUpd
Catalog Files Extension=.TCDBCat
Table Files Extension=.TCDBTbl
Table Index Files Extension=.TCDBIdx
Table BLOB Files Extension=.TCDBBlb
Table Publish Files Extension=.TCDBPbl
Remote Compression=0
Remote Host=XXX.X.X.X
Remote Address=192.1.1.4
Remote Port=12010
Remote Service=
Remote Encryption=0
Remote Timeout=180
Remote Ping=1
Remote Ping Interval=60
</FileContent>
<Variable />
</Action>
12/20/2013 9:37:22 AM End of Initializing of TextFileElement.
12/20/2013 9:37:22 AM Get Element from : <Action>
<ElementType>CustomUpdateElements.ReturnCodeElement</ElementType>
<ReturnCodeMethod>Variable</ReturnCodeMethod>
<StaticReturnCode>0</StaticReturnCode>
<Variable>4345b3d4-11e2-4ec3-95e7-c7cab8fb8d07</Variable>
</Action>
12/20/2013 9:37:22 AM Initializing ReturnCodeElement with : <Action>
<ElementType>CustomUpdateElements.ReturnCodeElement</ElementType>
<ReturnCodeMethod>Variable</ReturnCodeMethod>
<StaticReturnCode>0</StaticReturnCode>
<Variable>4345b3d4-11e2-4ec3-95e7-c7cab8fb8d07</Variable>
</Action>
12/20/2013 9:37:22 AM Running 3 Elements.
12/20/2013 9:37:22 AM Running CustomUpdateEngine.ExecutableElement
12/20/2013 9:37:22 AM Running ExecutableElement.
12/20/2013 9:37:22 AM Path To Executable starting with : TCClient_Install.exe
12/20/2013 9:37:22 AM Path To Executable ending with : TCClient_Install.exe
12/20/2013 9:37:22 AM Running : TCClient_Install.exe With arguments : /S /v/qn
12/20/2013 9:37:27 AM Exiting process.
12/20/2013 9:37:27 AM End of running ExecutableElement.
12/20/2013 9:37:27 AM Running CustomUpdateEngine.TextFileElement
12/20/2013 9:37:27 AM Running TextFileElement.
12/20/2013 9:37:27 AM Text file writed successfully.
12/20/2013 9:37:27 AM End of TextFileElement.
12/20/2013 9:37:27 AM Running CustomUpdateEngine.ReturnCodeElement
12/20/2013 9:37:27 AM Return Code Method is : Variable
12/20/2013 9:37:27 AM Returning : 1619
Coordinator
Dec 20, 2013 at 7:31 PM
This is because these custom actions doesn't expand Environnement Variables. Please send me an email to package.publisher@free.fr. I will reply with a new release of WPP that can do that. You will have delete the old update and do it again with this version.
Marked as answer by DCourtel on 1/17/2014 at 7:54 AM