Can i use FinalBuilder to set the name of a self extracting exe at Runtime? - installation

When using FinalBuilder to package our website, I would like it to be able to set the filename when it creates the file set with a variable somewhere else. So the filename would be Website 1.4.exe
Has anyone got this working?

I'm new to FinalBuilder, so if you could give some more info it would be useful - like which action you're using to create the exe.
Have you tried using project variables? From what I've seen you can use them in most FB actions.
At worst you could use the rename file action:
create a new project variable ([Tools\Edit Variables\Add]) called Version and give it a default value
if you need to, you can add a Set Variable action to dynamically set the value of the variable
add a Rename action
set Rename File to the file you want to rename (including path) eg c:\Release.exe
set New Name to Release%Version%.exe
That if the Version project variable is set to 1.4, Release.exe will be renamed to Release1.4.exe

Related

How to save a filename in a variable in Nifi?

I'm new to Nifi and I'm trying to get a file name and save this filename in a variable to be used later on in the process.
Basically I have a file(data_yyyyMMdd.tar.gz) which contains 2 .txt files(1.txt and 2.txt), and before to unpack this file, I want to save it's name to a variable and then, use this variable to add content to the unpacked files.
content of the files(originally) :
1.txt
id|name
1|apple
2|orange
content of the files after be updated with the filename
id|name|filename
1|apple|data_yyyyMMdd.tar.gz
2|orange|data_yyyyMMdd.tar.gz
I managed to unpack to file successfully, but, I'm not being able to save the .tar.gz filename in a variable and add it's value to the content of each file.
Could you guys help me?
Depending on what processor you used to get the tar.gz file, you likely already have a FlowFile attribute called filename set to the name of the tar.gz file. After unpacking you may find that the filename attribute is overwritten (not sure though), so before unpacking, copy the filename attribute into some other attribute using UpdateAttribute. For example you can add a property in UpdateAttribute named original.filename and set its value to ${filename}.
After unpacking you can use UpdateRecord to add the original filename as a field in each record, I think by setting the Replacement Value Strategy to Literal Value and adding a property /filename set to ${original.filename}. I haven't tried this so I don't know if these are exactly the right settings, but the approach should work.

Reduce file path when calling a file from terminal

I'm using Lua in interactive mode on a Mac (thanks to rudix.org).
When I want to load a file I do:
dofile("/my/long/path/to/my/directory/file.lua")
I want to do a different thing, that is:
put all my files in a desktop directory myDirectory;
then call the file from the terminal this way dofile("file.lua");
Is this possible? How?
If the path is fixed, you can just redefine dofile:
local _dofile=dofile
local path=("/my/long/path/to/my/directory/")
function dofile(x)
return _dofile(path..x)
end
You may put this (and other initializations) in a file and set the environment variable LUA_INIT to its location. After this, every invocation of lua will see the version of dofile redefined above and the users will be able to say simply dofile("foo.lua").
Alternatively, you can use require, which looks for modules in a list of paths in package.path or LUA_PATH.

TeamCity conflict with % symbol in Command Line build step

I have a batch file that I use to copy a folder and it's contents to a new location, it also creates the folder name based on the date and time (and this works):
SET TODAY=%DATE:/=-%
SET NOW=%TIME::=-%
XCOPY /S /Y "C:\BuildAgent\temp\buildTmp" "C:\Automation Results\%TODAY%_%NOW%\"
I added a new Configuration Step to my Team City setup, to include this batch file. The build step is a Command Line - Custom Script:
But this has an adverse effect on the TC Agent Requirements and I cannot start my TC builds:
This issue seems to be related to TC Implicit Requirements:
http://confluence.jetbrains.com/display/TCD8/Agent+Requirements
"Implicit Requirements
Any reference (name in %-signs) to an unknown parameter is considered an "implicit requirement". That means that the build will only run on the agent which provides the parameters named. Otherwise, the parameter should be made available for the build configuration by defining it on the build configuration or project levels."
How can I get around this TC conflict with % symbol which I need in my batch file?
Use %% instead of %
SET TODAY=%%DATE:/=-%%
SET NOW=%%TIME::=-%%
XCOPY /S /Y "C:\BuildAgent\temp\buildTmp" "C:\Automation Results\%%TODAY%%_%%NOW%%\"
This will ensure the variables are treated as batch file variables instead of TeamCity variables.
put the contents of your build script inside a file, eg copy.bat and call this batch file from TeamCity
Addtionally, change from Custom script to Executable with parameters

Visual Studio Setup Project - How to Obtain the Directory Path from a File-Search Launch Condition

I am looking for a way to add File(s) to an existing directory that has a random name as part of a Visual Studio Setup Project and I hoped someone might be able to help me solve this puzzle please.
I have been attempting to obtain the discovered path property of the directory using a Launch Condition; Unfortunately this method returns the full file path including the filename, which cannot be used as a directory property.
The directory in question takes the form [AppDataFolder]Company\Product\aaaaaaaaaaaa\
where aaaaaaaaaaaa is a random installation string.
Within the Launch Condition Setup I check for the directory's existence by searching for a file that would appear inside it,
Search Target Machine
(Name): File marker
Filename: sample.txt
Folder: [AppDataFolder]Company\Product\
Property: DIRFILE
Launch Condition
(Name): File marker exists
Condition: DIRFILE
In the Setup Project I add the file I wish to insert, with the details
Condition: DIRFILE
Folder: 'Installation folder'
Then in File System Setup I add a new folder entry for the random directory aaaaaaaaaaaa
(Name): Installation folder
Condition: DIRFILE
DefaultLocation: [DIRFILE]\..\ *Incorrect*
Property [DIRLOCATION]
As you can see the installer detects the existence of the marker file but, instead of placing my file at the same location, when using [DIRFILE] the installer would incorrectly try and insert it INTO the file;
This is because the file path was returned
[AppDataFolder]Company\Product\aaaaaaaaaaaa\sample.txt
where I instead need the directory path
[AppDataFolder]Company\Product\aaaaaaaaaaaa
Therefore I was wondering if it was possible to return the directory the file was found in from Search Target Machine (as opposed to the file location of the file), if I could extract the directory path by performing a string replace of the filename on the file location DIRFILE within the DefaultLocation field in File System Setup, or if perhaps there is even another method I am missing?
I'm also very interested in a simple solution for this, inside the setup project.
The way I did solve it was to install the files to a temporary location and then copy them to the final location in an AfterInstall event handler. Not a very elegant solution! Since it no longer care about the user selected target path I removed that dialog. Also I needed to take special care when uninstalling.
public override void OnAfterInstall(IDictionary savedState)
{
base.OnAfterInstall(savedState);
// Get original file folder
string originDir = Context.Parameters["targetdir"];
// Get new file folder based on the dir of sample.txt
string newDir = Path.GetDirectoryName(Context.Parameters["dirfile"]);
// Application executable file name
// (or loop for all files on the path instead)
string filename = "ApplicationName.exe";
// Move or copy the file
File.Move(Path.Combine(originDir, filename), Path.Combine(newDir, filename)));
}

Informatica Parameter File

Whenever I use the -lpf parameter with the pmcmd command, the workflow runs perfectly fine but when I add the same path in the Parameter FileName under Workflow 'Properties' and try to execute the workflow from the Workflow Manager, I get an error saying that parameter file is not found.
Now, the path which I am giving for '-lpf' is :
/apps/config/informatica/param.txt.
I don't understand why it works when I am overriding the parameter file name, whereas it doesn't work when I add it in the workflow properties (the file is not found).
By default, is any Informatica Environment variable set which needs to be changed and what's the default path of the parameter file on server and can this be changed?
Could you provide the log file?
Assuming I did understand this:
when you run the workflow with the parameter file -lpf that has this path:
/apps/config/informatica/param.txt
it does work, instead when you run it manually does not.
it could be so simply that manually you have to put instead of the extended path the string $PMSourceFileDir\ in the Source file Directory or to put it better: Source file Directory = $PMSourceFileDir\.
That because $PMSourceFileDir refer to the Informatica server initialization, as it is a server variable.
Instead with a parameter file usually is used to override that "deafult" path.

Resources