From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-08-2017 07:18 AM
Dear all,
I try to have te following action in my pre-build.vi. I have created a global boolean inside the project that enables/disables the watermark option for my report. This watermark has to be applied as long as the generated executable is in test fase so that it is clear that the reports created with this version are not official. Now I have created a pre-build.vi that let's me switch the global. However the watermark is not applied even though I set the global to true in the pre-build.vi
I'm clearly doing something wrong but I don't know how to solve this.
Your help is appreciated.
Regards,
Jeroen
Solved! Go to Solution.
12-08-2017 07:33 AM
Hello Jeroen,
For the debugging it will be useful if you provide the VI, or some more details, as there is no enough information to understand how you are using the pre-build.vi.
Thanks,
Arev
CTO | RAFA Solutions
12-08-2017 07:33 AM - edited 12-08-2017 07:34 AM
Hi Jeroen,
usually your executable should be in "test mode" (aka watermark) by default.
Only when the user provides a "key" (supplied by you) the software will switch off the watermark (and store the "key" for later use somewhere on the computer)…
No need to compile/install an executable twice!
(Hint: NI offers a toolkit for license management.)
12-08-2017 07:38 AM - edited 12-08-2017 07:41 AM
Hello Gerd,
A key is already needed, just to be able to run the program in the first place. I want some users to be able to test the program before making it final and release it to all users.
Hello Arev,
The code is not the issue. What I want is an option to select whether or not the executable I'm building is a final version or a test version. Where the test version will have the watermark applied to the report and the final version will not.
regards,
Jeroen
12-08-2017 07:46 AM
Just writing the global will probably not be sufficient. You might have to make the current value default after writing to it, then save the global. I think the compiler makes internal copies of VIs which will have the default value saved on disk, not a value set in a VI in memory.
12-08-2017 07:49 AM
12-08-2017 07:50 AM
I do similar things with a version number of the build. I change the string constant in an FGV during bre-build:
Don't mind that sub-vi, it changes the VI icon to reflect the version number.
Regards, Jens
12-08-2017 08:56 AM
What about using Project Conditional Diable Symbols?
With a Global variable, you need to change the value, and save the Globals with the new value a the default value.
Othervice the compiler just takes the code as it is and build the program.
When you execute the Global starts with the default value.
10-05-2018 04:11 AM
Hello Together
I got an issue to define enum Variables in dependency to their build. What i wanted to setup different builds which whould change me the variable to the correct setup. Is there a solution to generate different pre-build VIs in order to change them? Like a compiler switch in C.
best regards
mazim
10-05-2018 04:20 AM