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
- :
- Large Property Values
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
‎Dec 09, 2008
07:58 AM
Large Property Values
I've got an issue in IS12 (http://community.installshield.com/showthread.php?t=185075), but wondered if anyone has dealt with large amounts of data in a property (20k, licence code, even > 500 chars will do!) using IS2009.
Will look into upgrading if anyone can prove it works. All I want to do it take a long string in the UI, about 16k-20k and write it out to an XML file at exec time. IS12 seems to be blocking me, maybe IS2009 allows this?
Will look into upgrading if anyone can prove it works. All I want to do it take a long string in the UI, about 16k-20k and write it out to an XML file at exec time. IS12 seems to be blocking me, maybe IS2009 allows this?
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 09, 2008
10:09 AM
Assuming you're asking about InstallScript, I can verify that 500 characters works in InstallShield 2009: create a registry key HKCR\...MyKeyName with a string value LongValue with 1,000 characters. In the MSI project, create a system search that reads the value into a property PROP_WITH_LONG_VALUE. Create an InstallScript custom action---
[code]#include "ifx.h"
export prototype GetLongValue(HWND);
function GetLongValue(hInstall)
STRING sLongValue[2048];
NUMBER nBufferSize;
NUMBER nReturn;
begin
nBufferSize = 2049;
nReturn =
MsiGetProperty(hInstall, "PROP_WITH_LONG_VALUE", sLongValue, nBufferSize);
SprintfBox(INFORMATION,
"Long Property Value", "%d (%d) -> %s", nReturn, nBufferSize, sLongValue);
end;[/code]---and schedule it after the AppSearch action, and it seems to work...
[code]#include "ifx.h"
export prototype GetLongValue(HWND);
function GetLongValue(hInstall)
STRING sLongValue[2048];
NUMBER nBufferSize;
NUMBER nReturn;
begin
nBufferSize = 2049;
nReturn =
MsiGetProperty(hInstall, "PROP_WITH_LONG_VALUE", sLongValue, nBufferSize);
SprintfBox(INFORMATION,
"Long Property Value", "%d (%d) -> %s", nReturn, nBufferSize, sLongValue);
end;[/code]---and schedule it after the AppSearch action, and it seems to work...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 09, 2008
05:40 PM
Does the AppSearch happen in exec time, after UI?
Thanks for the research.
Thanks for the research.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 09, 2008
06:08 PM
You can look in the Sequences and Actions view to see when the AppSearch action runs: early in the UI sequence (for a full-UI installation) or Execute sequence (for a silent/reduced-UI installation).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 10, 2008
02:22 AM
Hmmm, thanks. Maybe I'll get a test copy or something, I could always get it to work in the UI section, its the exec section its not working in.
Many thanks!
Many thanks!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 10, 2008
06:11 PM
Where is the property set, and where in the Execute sequence are you getting the value?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 11, 2008
04:34 AM
The data is being picked up from an XML file (or copied into a textbox during the UI). I confirmed that all the data is there as I can see it in the textbox, and if I move between forms the data is kept. I have a CA to read the XML file, and in that script just to test it, I did Set and Gets and message boxed the results and the data was all there.
I was trying to put the output back into the XML file using the built in "XML File Changes" part of IS. This was just outputting a blank string. I believe this is done by ISXmlInstall. When this stopped working I attempted to do it manually believing it to be a problem with that part of the system. I added a CA which ran after WriteIniValues, in there was the Get property script very similar to what you have shown.
Every time I try and read that property I get the error as described above. If the data is short it works, so the mechanism is working fine. I just don't understand how (or why) it chops it off. To add, it always tells me I need 1024 extra returned from the Size parameter.
We are very close to release date so I have had to actually remove this screen from the installer and now the user has to load our software afterwards to enter their licensekey :(. When I have the time we likely upgrade to 2009, and if this feature works I can add the screen back in.
I was trying to put the output back into the XML file using the built in "XML File Changes" part of IS. This was just outputting a blank string. I believe this is done by ISXmlInstall. When this stopped working I attempted to do it manually believing it to be a problem with that part of the system. I added a CA which ran after WriteIniValues, in there was the Get property script very similar to what you have shown.
Every time I try and read that property I get the error as described above. If the data is short it works, so the mechanism is working fine. I just don't understand how (or why) it chops it off. To add, it always tells me I need 1024 extra returned from the Size parameter.
We are very close to release date so I have had to actually remove this screen from the installer and now the user has to load our software afterwards to enter their licensekey :(. When I have the time we likely upgrade to 2009, and if this feature works I can add the screen back in.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2014
01:28 PM
Bumping this thread...
Robert, I note that you've set the buffer to 2049 in this example. Is there a particular reason for this?
(I ask because the script engine seems to crash when you try to MsiGetProperty a value that is 2050 characters long...)
Robert, I note that you've set the buffer to 2049 in this example. Is there a particular reason for this?
(I ask because the script engine seems to crash when you try to MsiGetProperty a value that is 2050 characters long...)
RobertDickau wrote:
Assuming you're asking about InstallScript, I can verify that 500 characters works in InstallShield 2009: create a registry key HKCR\...MyKeyName with a string value LongValue with 1,000 characters. In the MSI project, create a system search that reads the value into a property PROP_WITH_LONG_VALUE. Create an InstallScript custom action---
[code]#include "ifx.h"
export prototype GetLongValue(HWND);
function GetLongValue(hInstall)
STRING sLongValue[2048];
NUMBER nBufferSize;
NUMBER nReturn;
begin
nBufferSize = 2049;
nReturn =
MsiGetProperty(hInstall, "PROP_WITH_LONG_VALUE", sLongValue, nBufferSize);
SprintfBox(INFORMATION,
"Long Property Value", "%d (%d) -> %s", nReturn, nBufferSize, sLongValue);
end;[/code]---and schedule it after the AppSearch action, and it seems to work...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2014
04:43 PM
In fact, I found that it fails catastrophically exactly at 2050 characters, which you can see yourself below:
[CODE]function MyFunction(hMSI)
STRING sBuffer[8000],sCount,sError;
number nSize, i, nResult;
begin
nSize = 4096;
for i = 1 to 4096
try
nSize = 4096;
nResult = MsiGetProperty(hMSI, "MYPROP", sBuffer, nSize);
if(StrLength(sBuffer) = 0) then
NumToStr(sCount,i);
MessageBox("Lost property value at char count: " + sCount,0);
else
//We don't make it to this point 2051 times, it quits on the next MsiGetProperty()
MsiSetProperty(hMSI,"MYPROP",sBuffer + "X");
endif;
catch
NumToStr(sError,Err.Number);
MessageBox("2050 char error: " + sError,0);
endcatch;
endfor;
end;[/CODE]
This is in IS2010 and 2012 (although I am told by a colleague of mine that it seems fine in IS2013 SP1). Known issue, with a known fix maybe?
[CODE]function MyFunction(hMSI)
STRING sBuffer[8000],sCount,sError;
number nSize, i, nResult;
begin
nSize = 4096;
for i = 1 to 4096
try
nSize = 4096;
nResult = MsiGetProperty(hMSI, "MYPROP", sBuffer, nSize);
if(StrLength(sBuffer) = 0) then
NumToStr(sCount,i);
MessageBox("Lost property value at char count: " + sCount,0);
else
//We don't make it to this point 2051 times, it quits on the next MsiGetProperty()
MsiSetProperty(hMSI,"MYPROP",sBuffer + "X");
endif;
catch
NumToStr(sError,Err.Number);
MessageBox("2050 char error: " + sError,0);
endcatch;
endfor;
end;[/CODE]
This is in IS2010 and 2012 (although I am told by a colleague of mine that it seems fine in IS2013 SP1). Known issue, with a known fix maybe?
Cary R wrote:
Bumping this thread...
Robert, I note that you've set the buffer to 2049 in this example. Is there a particular reason for this?
(I ask because the script engine seems to crash when you try to MsiGetProperty a value that is 2050 characters long...)