This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to insert Date/revision number on a Dialog
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 16, 2010
04:36 AM
How to insert Date/revision number on a Dialog
Hi
I would like to insert a date or revision number on a Dialog, how do I do this?
Cheers
Kellelein
I would like to insert a date or revision number on a Dialog, how do I do this?
Cheers
Kellelein
(9) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 17, 2010
03:50 AM
You may customize dialog, use EzDefineDialog().
Create a new text field on dialog for version\date.
Insert version\date by CtrlSetText() function from your script.
Create a new text field on dialog for version\date.
Insert version\date by CtrlSetText() function from your script.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 17, 2010
08:31 AM
This solution will only work with InstallScript "Sd..." (Script defined) dialogs. What is your project type? (e.g. InstallScript, InstallScript MSI, Basic MSI)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 18, 2010
02:30 AM
It is a InstallShield 2008 project and just a normal Basic MSI project.
Have tried a lot of things now and nothing worked 😞
CtrlSetText()
GetFileDate()
SRCDIR
Just want to write, to a Text field!!!!! on InstallWelcome dialog
Version 1.0
Revision xxxx-xx-xx
I use CtrlSetText('InstallWelcome', ???????, 'test');
Where do I find the Text ID?
Best regards
Kellelein
Have tried a lot of things now and nothing worked 😞
CtrlSetText()
GetFileDate()
SRCDIR
Just want to write, to a Text field!!!!! on InstallWelcome dialog
Version 1.0
Revision xxxx-xx-xx
I use CtrlSetText('InstallWelcome', ???????, 'test');
Where do I find the Text ID?
Best regards
Kellelein
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 18, 2010
08:11 AM
Aha! Ignore that CtrlSetText stuff as you're not using an InstallScript project. InstallScript projects are all about scripted logic, whereas basic MSI is all about the tables. Set the text box control's "text" field equal to a property name in brackets. For instance, set it to [PRODUCT_VERSION]. Then just set the property value sometime before the dialog comes up, either by using a "Set a property" custom action or by means of a scripted custom action.
In my setups, I like to take the version information from the same header file as is used by the rest of the product. I therefore use an InstallScript CA that uses constants defined in our "Version.h" file to assign all version-related strings in my installer.
Assuming your header file defines, for example, [CODE][FONT="Courier New"]#define VERSION_STRING "1.0.0.1234"[/FONT] [/CODE]
Just use MsiSetProperty( "PRODUCT_VERSION", VERSION_STRING ); and you should be all set.
In my setups, I like to take the version information from the same header file as is used by the rest of the product. I therefore use an InstallScript CA that uses constants defined in our "Version.h" file to assign all version-related strings in my installer.
Assuming your header file defines, for example, [CODE][FONT="Courier New"]#define VERSION_STRING "1.0.0.1234"[/FONT] [/CODE]
Just use MsiSetProperty( "PRODUCT_VERSION", VERSION_STRING ); and you should be all set.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2010
04:41 AM
Still can't get it to work 😞
where do I call MsiSetProperty() from? do I have to make an InstallScript, and call it from there???
Cheers
Kellelein
where do I call MsiSetProperty() from? do I have to make an InstallScript, and call it from there???
Cheers
Kellelein
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2010
08:08 AM
Okay, if you just want to statically set a date or rivision number (which would require manual interaction at every build, and therefore be unadvisable) you simply need to create the text box on the dialog using the dialog design view and enter the literal values. this is trivial, therefore i'm going to assume you're not asking the forum how to use the dialog designer.
i'm assuming you are really trying to automate this stuff so you don't have to modify it manually on every build. (you weren't really this specific in your question.) The next question would be "Where is the date/version info coming from?" I further assumed that you have a header file with this information, and you want to display the information which is in that header file on the dialog. since InstallScript can understand most stuff from a regular c style header file, i would recommend using an installscript custom action to take information from the header file, and use it to set the property. start by writing the function in installscript (make sure to use "export" in your function prototype) and then use the custom action wizard to create an immediate-execution InstallScript Custom Action that calls your exported function.
i'm assuming you are really trying to automate this stuff so you don't have to modify it manually on every build. (you weren't really this specific in your question.) The next question would be "Where is the date/version info coming from?" I further assumed that you have a header file with this information, and you want to display the information which is in that header file on the dialog. since InstallScript can understand most stuff from a regular c style header file, i would recommend using an installscript custom action to take information from the header file, and use it to set the property. start by writing the function in installscript (make sure to use "export" in your function prototype) and then use the custom action wizard to create an immediate-execution InstallScript Custom Action that calls your exported function.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 23, 2010
02:11 AM
Ok, what I want, is to insert a date on a dialog, this has to be done automatic. I have made an InstallScript and can set a text on a dialog now. I do this with a custom action, where I call the script (I forgot to insert this in the Installation Sequence and that's why I couldn't get it to work first).
I want to use the date from the setup.msi file. I can locate the file, with my script, but my GetFileDate, dosen't seem to work and I can't figure out to debug the script....
My Script look like this:
#include "ifx.h"
export prototype MyFunction(HWND);
prototype GetFileDate (BYREF string, string);
//MyFunction---------------------------------------------------------
function MyFunction(hMSI)
string fileInfo;
string file;
begin
file = SRCDIR^"UniLock.msi";
GetFileDate(file, fileInfo);
MsiSetProperty(NULL, "UNILOCK_REVISION", fileInfo);
end;
//-------------------------------------------------------------------
//GetFileDate--------------------------------------------------------
function GetFileDate (fileName, fileDate)
string fileTime;
number dummy;
begin
if !Is (FILE_EXISTS, fileName) then fileDate = "???";
return;
endif;
GetFileInfo (fileName, FILE_DATE, dummy, fileDate);
fileDate [4] = "-";
fileDate [7] = "-";
GetFileInfo (fileName, FILE_TIME, dummy, fileTime);
StrSub (fileTime, fileTime, 0, 5);
fileDate = fileDate + " " + fileTime;
end;
//-------------------------------------------------------------------
I want to use the date from the setup.msi file. I can locate the file, with my script, but my GetFileDate, dosen't seem to work and I can't figure out to debug the script....
My Script look like this:
#include "ifx.h"
export prototype MyFunction(HWND);
prototype GetFileDate (BYREF string, string);
//MyFunction---------------------------------------------------------
function MyFunction(hMSI)
string fileInfo;
string file;
begin
file = SRCDIR^"UniLock.msi";
GetFileDate(file, fileInfo);
MsiSetProperty(NULL, "UNILOCK_REVISION", fileInfo);
end;
//-------------------------------------------------------------------
//GetFileDate--------------------------------------------------------
function GetFileDate (fileName, fileDate)
string fileTime;
number dummy;
begin
if !Is (FILE_EXISTS, fileName) then fileDate = "???";
return;
endif;
GetFileInfo (fileName, FILE_DATE, dummy, fileDate);
fileDate [4] = "-";
fileDate [7] = "-";
GetFileInfo (fileName, FILE_TIME, dummy, fileTime);
StrSub (fileTime, fileTime, 0, 5);
fileDate = fileDate + " " + fileTime;
end;
//-------------------------------------------------------------------
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 23, 2010
07:57 AM
there's a few ways you can debug. You can throw in a bunch of calls to MessageBox() to spit out some info, but since you're dealing with an immediate execution custom action, i'd recommend using the debugger. if you click the white "!" icon at the top of the IS IDE, then it'll run your installation, and for every InstallScript Custom Action, it will launch a debug window, wherein you can step through your InstallScript to see what's happening.
Your code looks logically correct, but i'll try to spend a few more minutes on your problem this evening if you haven't come up with your answer by then.
Your code looks logically correct, but i'll try to spend a few more minutes on your problem this evening if you haven't come up with your answer by then.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2010
03:40 AM
Problem solved....Thank you very much for your help...
I debuged the script and found that the prototype defenition for GetFileDate missed a BYREF on the returning string...
The script ended up by this...
//Included headers-----------------------------------------
#include "ifx.h"
//---------------------------------------------------------
//Functions definitions------------------------------------
export prototype MyFunction(HWND);
prototype GetFileDate (BYREF string, BYREF string);
//---------------------------------------------------------
//MyFunction-----------------------------------------------
function MyFunction(hMSI)
string fileInfo;
string file;
number dummy;
begin
file = SRCDIR^"UniLock.msi";
GetFileDate(file,fileInfo);
MsiSetProperty(NULL, "UNILOCK_REVISION", fileInfo);
end;
//---------------------------------------------------------
//GetFileDate----------------------------------------------
function GetFileDate(fileName, fileDate)
string fileTime;
number dummy;
begin
if !Is (FILE_EXISTS, fileName) then fileDate = "???";
return;
endif;
GetFileInfo(fileName, FILE_DATE, dummy, fileDate);
fileDate [4] = "-";
fileDate [7] = "-";
GetFileInfo(fileName, FILE_TIME, dummy, fileTime);
StrSub(fileTime, fileTime, 0, 5);
fileDate = fileDate + " " + fileTime;
end;
//---------------------------------------------------------
I debuged the script and found that the prototype defenition for GetFileDate missed a BYREF on the returning string...
The script ended up by this...
//Included headers-----------------------------------------
#include "ifx.h"
//---------------------------------------------------------
//Functions definitions------------------------------------
export prototype MyFunction(HWND);
prototype GetFileDate (BYREF string, BYREF string);
//---------------------------------------------------------
//MyFunction-----------------------------------------------
function MyFunction(hMSI)
string fileInfo;
string file;
number dummy;
begin
file = SRCDIR^"UniLock.msi";
GetFileDate(file,fileInfo);
MsiSetProperty(NULL, "UNILOCK_REVISION", fileInfo);
end;
//---------------------------------------------------------
//GetFileDate----------------------------------------------
function GetFileDate(fileName, fileDate)
string fileTime;
number dummy;
begin
if !Is (FILE_EXISTS, fileName) then fileDate = "???";
return;
endif;
GetFileInfo(fileName, FILE_DATE, dummy, fileDate);
fileDate [4] = "-";
fileDate [7] = "-";
GetFileInfo(fileName, FILE_TIME, dummy, fileTime);
StrSub(fileTime, fileTime, 0, 5);
fileDate = fileDate + " " + fileTime;
end;
//---------------------------------------------------------
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)