Start Menu Group and Program Files path allowing illegal Windows characters

Got a problem you cannot solve? Try here.
Post Reply
dileep.tiwari
Posts: 16
Joined: Thu Sep 05, 2019 6:42 am

Start Menu Group and Program Files path allowing illegal Windows characters

Post by dileep.tiwari »

Hi,
I am just doing some R&D and i found StartMenu and ProgramFIles path are allowing users to enter Illegal character for eg.
find attached startmenu.jpg and programfiles.jpg
i dont want to allow user to put any illegal characters to either startmenu or in programfiles path.
if anybody enters illegal characters in startmenu or in programfiles path NEXT button should be disabled.(NEXT button only enables if all entered characters are legal)
it there any way to achieve this. does installaware provide this functionality.

Thanks,
Dileep
Attachments
programfiles.JPG
programfiles.JPG (14.36 KiB) Viewed 5353 times
startmenu.JPG
startmenu.JPG (12.29 KiB) Viewed 5353 times
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Start Menu Group and Program Files path allowing illegal Windows characters

Post by FrancescoT »

You may use the "Parse String" script command for that.
The command parses a string by a given pattern or position index and splits the result into two new strings.
Then you can use the returned strings to validate your path.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
dileep.tiwari
Posts: 16
Joined: Thu Sep 05, 2019 6:42 am

Re: Start Menu Group and Program Files path allowing illegal Windows characters

Post by dileep.tiwari »

Can i get any example sample if it is available.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Start Menu Group and Program Files path allowing illegal Windows characters

Post by FrancescoT »

No, there isn't a specific sample available.
...let me see if I still have one.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Start Menu Group and Program Files path allowing illegal Windows characters

Post by FrancescoT »

With the help of the "Match Regular Expression" script command, it's really a simple matter.

For example:

Set Variable MYPATH to c:\test my pa*th
Set Variable ILLEGAL_PATTERN to [?*"\|]
Set Variable RESULT to

Match string "$MYPATH$" to regular expression "$ILLEGAL_PATTERN$", return result in variable RESULT
if Variable RESULT Equals TRUE
MessageBox: Debug, Path contains not allowed characters!
end


Code: Select all

~InstallAware Clipboard Data~
~End~
~{970D8624-46C3-4579-9292-228853ABC057}~
~MessageBox~
~{D5FA8B62-F4E2-4476-8FC6-99EE3647EA51}~
~Debug~
~Path contains not allowed characters!~
~0~
~1~
~~
~If~
~{740837F9-D8BA-4690-ADA4-2695441DB1E2}~
~RESULT~
~0~
~TRUE~
~FALSE~
~Match Regular Expression~
~{4203C2CA-B8BF-4BB9-88B6-8EFE45528245}~
~RESULT~
~$ILLEGAL_PATTERN$~
~$MYPATH$~
~Comment~
~{F61E11DD-D883-4399-A697-DFB6A08B306F}~
~~
~Set Variable~
~{F2C37E85-36A4-4452-8CBC-6537433FE355}~
~RESULT$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{F0BD3777-039C-4593-968E-1E93D5F8D226}~
~ILLEGAL_PATTERN$MYAH$MYAH$FALSE~
~[?*"\|]~
~Set Variable~
~{2C6F4A85-0C8D-4601-B58B-8A412E044B4A}~
~MYPATH$MYAH$MYAH$FALSE~
~c:\test my pa*th~
Hope this helps you.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply