Didn't understand that scripting

Got a problem you cannot solve? Try here.
Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Didn't understand that scripting

Postby Pixbyte » Fri Feb 17, 2006 10:49 pm

Hello,

I am really confused about Installaware and I hope someone can help me out of this problem:

A few days I ask how to check the length of an String. Cause I do not find any information, only an Function "Parse String". I didn't understand this function but the Team gaves me great help.
However, now Iam at an point, where I think to validate an Serialnumber with Installaware is really impossible, if it is possible, I ask the Team to remove the Header "Without rocket Science" ;)

Ok, I have now an, in my eyes, very complicated method to check if my string is 30 chars long. But one of the most common and used featrues I missed. How can I trim an Textfield? I run now in big trouble cause some users enters the key with an space (Copy&Paste problem) Now the function can check the length with Parse String but I can only Trim the result. So I do not want to have 50 lines in my code with Parse string calls. Parse this part then this and then this sometimes I get the real length.

So please give me an accurate way to check an Serialnumber an really good way and not an Rocket science way. I mean "Trim" is an basic development function!

However I found some other problems. After Parse Sring (PART1 and PART2) I tried to work with PART1 or PART2. But I cannot do anything with this. If I try

Code: Select all

      MessageBox: X, Key is 30 long $PART1$ and $PART2$
Everyting is empty. If I try

Code: Select all

      Set Variable KEYA1 to PART1
KEYA1 is the Text PART1. If I try

Code: Select all

      Set Variable KEYA1 to $PART1$
KEYA1 is empty.

So please please give me help!

Ocrana

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Sat Feb 18, 2006 12:02 am

Hello,

ok, I have now used Replace String to delete all spaces. I think not the best way but I hope this will work. However, the issue with the PART1 and PART2 is still there. Why I cannot work with this?

Ocrana

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Feb 18, 2006 9:15 am

Hi Ocrana!

I'm not sure I understand your question! Can you please state it a little more clearly? I'm sure there's a way without rocket science :)
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Sat Feb 18, 2006 12:01 pm

Ups, do I think to deep with rocket science ;)

Ok, which part do you not understand, the first Path with "Trim" or the second part with the "Parse String" question? I wil ltry to explain then more detailed.

Ingo

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Feb 18, 2006 3:28 pm

Hi!

Basically, I'm not clear about what you're trying to achieve, how you tried to go about it, and what went wrong!
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Sat Feb 18, 2006 5:51 pm

OK, I will answer in two posting to make an better overview:

1.) Working with forms
In some reasons the user have to work with informations from fields inside an dialog. special into Registration/Licensing. The most common is Serials.

Ok, now we have the possibility to enter text into an textfield. But we know all, that there are very stupid users out there. So it occours very often that the serial of Name or Companyname are wirtten into the textfield but there are not vaild chars inside. The most know is an space in the front or at the end of an entry. Let us say it is most time a copy & paste error.

Ok, in every development language we have he default function "TRIM". Or TRIMLEFT or TRIMRIGHT or however. This function delete Spaces at the beginning an at the end. An "REPLACE" is often bad, cause special in names you have an space between Name and Prename.

We use this command TRIM in Webscripts and Softwares and it is suggested everywhere to avoid trouble later.

But this is impossible with Installaware. So my question is, why an really basic command, to handle Strings from Fields is not there?

In my case, with the software I do actual, Replace String is an dirty hack, cause I do not have any spaces inside the string I work with. But we have also other software that need to check the name / copmpanyname and serial to check. So finaly this is not possible with Installaware.

So finaly it will be very nice if you can bring an function TRIM in the future that allow us to delete spaces at the beginning / end of an string from an textfield without "Rocket science" ;)

Ingo

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Sat Feb 18, 2006 5:58 pm

2.) Parse String trouble
Here I have following problem. I split an string into two variables. PART1 and PART2. Now I check if one is empty:

Code: Select all

if PART1 equal


It works. But now I wnt to use the second String PART2 inside my code/script. So I tried to set the PART2 into another variable

Code: Select all

Set variable KEYA1 to PART1


This will bring the value of KEYA1 to "PART1" text.
It tried also:

Code: Select all

Set variable KEYA1 to $PART1$


This result will be an empty KEYA1.

So I was confused, I checked with the developer defaut test. I use an MessageBox. I set:

Code: Select all

 MessageBox: Wrong Serial, Show me $PART1$ and $PART2"


The result of this MessageBox is "Show me and "
So i think I cannot work with the variables/strings from the Parse String function and that is very confusing to me.

Is this more clear now?

Ingo

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Feb 18, 2006 8:10 pm

I think the Parse String trouble you are reporting may be related to a bug in Parse String which was fixed in InstallAware 5.1. What version are you currently running?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Sat Feb 18, 2006 8:18 pm

5.11

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Feb 18, 2006 10:01 pm

That version doesn't have any issues with Parse String. Are you trying to say that Parse String is failing for you? Please make sure you have the command configured properly.

Also, it suddenly occured to me that you are making this whole thing a lot more complex than needs be. You can specify input masks in your serial dialog, so users may only enter the characters they are allowed to enter. You can even specify a maximum length together with auto-tabbing to the next edit field on the dialog when that length has been reached.

Both of these would resolve the trim issues, etc. directly at the dialog level, where data is being provided by the user, and you wouldn't have to worry about trimming, parsing, etc! I think maybe you got used to doing things the hard way in InstallShield so are looking for complicated solutions in InstallAware ;)

There's a post on this forum for both auto tabbing and setting masks - let me know if you cannot find them. But you should be set!
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Sat Feb 18, 2006 10:05 pm

Sure, it seems that I am a little bit InstallShield "damaged" ;)
Thanks, I will try the mask thing you describe.

Ingo

casic
Posts: 260
Joined: Thu Mar 17, 2005 4:02 am
Location: Germany
Contact:

Postby casic » Mon Feb 20, 2006 2:30 am

Hi,

I recommend to externalize the serial number check into a DLL. This can be done with PureBasic easily and protects your source code from reverse engineering.

cu

Markus
Markus Diettrich
InstallAware MVP
If it can't be done with InstallAWARE then you are not using Windows

Pixbyte
Posts: 19
Joined: Tue Feb 07, 2006 4:04 pm

Postby Pixbyte » Mon Feb 20, 2006 3:50 am

Hi Markus,

I do not think that it is everytime a must to put everything into an own DLL. If I have to put all operations/functions into an DLL I can build my own Setup Software or diretly use NSIS. I expected some comfort from an Setup Suite.

However, I expected that basic functions, like to read out an String from an Textfiled will supported. For this the very first basic function is to trim out spaces.

So finaly there are two ways 1.) I have an Script with an language that support basic operations, 2.) I have an Script where I have to develop everything into an DLL or Plugins. But why I need an software like Installaware then?

Clearly to say it in the words of Installaware...do I need rocket science or not? ;)

Ingo

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Feb 20, 2006 10:59 am

Hi Ingo

Did you try the input mask I suggested - this would be the correct and easy approach for you. Anything else will be too much unnecessary work!
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 185 guests