Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Checkbox related problem


2 replies to this topic

epriya2003

epriya2003
  • Members
  • 22 posts

Posted 23 January 2006 - 11:51

The purpose is

when the checkbox for "create short cut" is checked,the shortcut should be created at the end of installation.
when the checkbox for "include in Startup Folder" is checked,the exe should be included in Startup Folder at the end of installation.

Now for this purpose I am doing as follows:

creating two features:
----------------------

ShortCut InstallLevel = 1 Required = No
StartUp InstallLevel = 1 Required = No

Creating Corresponding components:
-----------------------------------

ShortcutOnDesktop : Under shortcut Heading, creating shortcut of exe for feature "ShortCut"
IncludeInStartUp : Under shortcut Heading, creating shortcut of exe for feature "StartUp"


Now, for checkbox of Shortcut:
------------------------------

Property : ADDSHORTCUTTODESKTOP
Value : 1
PropertyIsInteger : true


On "Next" Button, events are added as follows:
----------------------------------------------

ADDLOCAL | ShortCut | ADDSHORTCUTTODESKTOP="1"
REMOVE | ShortCut | ADDSHORTCUTTODESKTOP="0"


for checkbox of including in Startup folder:
--------------------------------------------
--------------------------------------------

Property : ADDSHORTCUTTODESKTOP
Value : 1
PropertyIsInteger : true


On "Next" Button, events are added as follows:
----------------------------------------------

ADDLOCAL | StartUp | INCLUDEINSTARTUPFOLDER="1"
REMOVE | StartUp | INCLUDEINSTARTUPFOLDER="0"



In property manager view,
-------------------------

ADDSHORTCUTTODESKTOP 0
INCLUDEINSTARTUPFOLDER 0

OUTPUT:

The result is when the checkbox is not checked then the exe is found at both places i.e. desktop and startup.[WRONG]

when the checkbox is checked for ShortCut
then the exe is not found at desktop.[WRONG]
when the checkbox is checked for ShortCut
then the exe is found at desktop.[RIGHT]

Kindly let me know where I am wrong ??



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 January 2006 - 09:12

Let's look at what you have and where the problems might be:

QUOTE
ShortCut InstallLevel = 1 Required = No
StartUp InstallLevel = 1 Required = No

So both features are selected by default. No real prpblem here, but if your
want the properties default to not create these shortcuts then I would make
the features unselected by default.

QUOTE
On "Next" Button, events are added as follows:
----------------------------------------------

ADDLOCAL | ShortCut | ADDSHORTCUTTODESKTOP="1"
REMOVE | ShortCut | ADDSHORTCUTTODESKTOP="0"

Problems:
Those control events are called AddLocal and Remove (case sensitive).
When a check box is unchecked then the associated property is undefined
(empty), not 0.
So you better change this to:

AddLocal | ShortCut | ADDSHORTCUTTODESKTOP="1"
Remove | ShortCut | ADDSHORTCUTTODESKTOP<>="1"

Same for the other check box.

QUOTE
In property manager view,
-------------------------

ADDSHORTCUTTODESKTOP 0
INCLUDEINSTARTUPFOLDER 0

Don't define them in property manager. Thus the check box will be unchecked
by default.

QUOTE
OUTPUT:

The result is when the checkbox is not checked then the exe is found at both places i.e. desktop and startup.[WRONG]

That's because the wrong condition on the Remove events.

QUOTE
when the checkbox is checked for ShortCut
then the exe is not found at desktop.[WRONG]
when the checkbox is checked for ShortCut
then the exe is found at desktop.[RIGHT]

That's a contradiction. What did you really mean to say?




epriya2003

epriya2003
  • Members
  • 22 posts

Posted 25 January 2006 - 04:59

Thanks Stefan. Its working fine now.

Thanks and regards,
Priya