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
- :
- Re: ALLUSERS again...
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 12, 2007
08:00 AM
ALLUSERS again...
I have searched and read quite some threads in the forum regarding ALLUSERS settings, both on InstallShield and MSDN, but still doesn't know exactly what I need to do to set ALLUSERS in InstallScript.
What I need is this: I have a procedure in InstallScript to add a shortcut on the desktop and Start\AllPrograms at the end of install. So I use the following script,
[FONT="Courier New"][SIZE="2"]if (BUTTON_CHECKED = CtrlGetState(szDialogName, CHKBX_DESKTOP)) then
AddFolderIcon (DesktopFolder, "myApp", PATH_APPEXE, INSTALLDIR, PATH_ICO, 0, "", REPLACE);
endif;
if (BUTTON_CHECKED = CtrlGetState(szDialogName, CHKBX_STARTPROGRAMS)) then
AddFolderIcon (ProgramMenuFolder, "Pogo", PATH_APPEXE, INSTALLDIR, PATH_ICO, 0, "", REPLACE);
endif;[/SIZE][/FONT]
I had checked the "Automatically create ISSetAllUsers action" checkbox under the Options -> General tab, so I supposed the shortcuts would install to the AllUsers folder under Documents&Settings when installed by an administrator and install to folder when installed by any other users. But it's not. It always installed under folder.
So I supposed that "Automatically create ISSetAllUsers action" checkbox didn't mean to set install to AllUsers as default. Then I read those postings in forums and tried adding
[FONT="Courier New"][SIZE="2"]ALLUSERS = 1;[/SIZE][/FONT]
right before the above script, but the shortcuts still did not install for all users when installed by an administrator.
Can anyone let me know where I should set the ALLUSERS variable, or do I have to use other functions?
(Oh, by the way, don't ask me why I don't use the built-in dialog for adding shortcuts. It's a company requirement. :))
What I need is this: I have a procedure in InstallScript to add a shortcut on the desktop and Start\AllPrograms at the end of install. So I use the following script,
[FONT="Courier New"][SIZE="2"]if (BUTTON_CHECKED = CtrlGetState(szDialogName, CHKBX_DESKTOP)) then
AddFolderIcon (DesktopFolder, "myApp", PATH_APPEXE, INSTALLDIR, PATH_ICO, 0, "", REPLACE);
endif;
if (BUTTON_CHECKED = CtrlGetState(szDialogName, CHKBX_STARTPROGRAMS)) then
AddFolderIcon (ProgramMenuFolder, "Pogo", PATH_APPEXE, INSTALLDIR, PATH_ICO, 0, "", REPLACE);
endif;[/SIZE][/FONT]
I had checked the "Automatically create ISSetAllUsers action" checkbox under the Options -> General tab, so I supposed the shortcuts would install to the AllUsers folder under Documents&Settings when installed by an administrator and install to
So I supposed that "Automatically create ISSetAllUsers action" checkbox didn't mean to set install to AllUsers as default. Then I read those postings in forums and tried adding
[FONT="Courier New"][SIZE="2"]ALLUSERS = 1;[/SIZE][/FONT]
right before the above script, but the shortcuts still did not install for all users when installed by an administrator.
Can anyone let me know where I should set the ALLUSERS variable, or do I have to use other functions?
(Oh, by the way, don't ask me why I don't use the built-in dialog for adding shortcuts. It's a company requirement. :))
(11) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 12, 2007
09:21 AM
I think what you want is:
So it would be something like this:
Or you could do a Set Property custom action, but that is probably more work and this one line of code.
MsiSetProperty(
MSIHANDLE hInstall,
LPCTSTR szName,
LPCTSTR szValue
);
So it would be something like this:
MsiSetProperty(hMSI, "ALLUSERS", "1");
Or you could do a Set Property custom action, but that is probably more work and this one line of code.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 12, 2007
10:04 AM
I just tried [FONT="Courier New"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");[/FONT] but the shortcuts are still created in:
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\ \Desktop
C:\Documents and Settings\ \Start Menu\Programs[/SIZE][/FONT]
instead of:
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\All Users\Desktop
C:\Documents and Settings\All Users\Start Menu\Programs[/SIZE][/FONT]
Maybe...are there any additional settings I need to make for the MsiSetProperty() funtion to come into effect?
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\
C:\Documents and Settings\
instead of:
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\All Users\Desktop
C:\Documents and Settings\All Users\Start Menu\Programs[/SIZE][/FONT]
Maybe...are there any additional settings I need to make for the MsiSetProperty() funtion to come into effect?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 12, 2007
10:25 AM
How are your shortcuts defined? Are you using the system properties for folder names or did you hard code them?
What does you log say in regards to property values?
What does you log say in regards to property values?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 12, 2007
11:06 AM
Try using ProgDefGroupType(COMMON); this should set folders you need to AllUsers.
i would do do something like this just before you call your script to add icons:
If (ALLUSERS = 1 ) then
ProgDefGroupType(COMMON);
else
ProgDefGroupType(PERSONAL);
i would do do something like this just before you call your script to add icons:
If (ALLUSERS = 1 ) then
ProgDefGroupType(COMMON);
else
ProgDefGroupType(PERSONAL);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2007
06:58 AM
Tried. The same. Shortcuts still installed to
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\ [/SIZE][/FONT]
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2007
07:10 AM
We maybe able to help more if you posted the code for the shortcut creation.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2007
09:33 AM
Here is the code again:
[FONT="Courier New"][SIZE="2"]if (BUTTON_CHECKED = CtrlGetState(szDialogName, CHKBX_DESKTOP)) then
AddFolderIcon (DesktopFolder, "MyApp", PATH_APPEXE, INSTALLDIR, PATH_ICO, 0, "", REPLACE);
endif;[/SIZE][/FONT]
Here are what I have done - right above of these three lines of script, I tried to put:
case 1:
[FONT="Courier New"][SIZE="2"]ALLUSERS = 1;[/SIZE][/FONT]
case 2:
[FONT="Courier New"][SIZE="2"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");[/SIZE][/FONT]
case 3:
[FONT="Courier New"][SIZE="2"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");
if (ALLUSERS != 1 ) then
ProgDefGroupType(COMMON);
else
ProgDefGroupType(PERSONAL);
endif;[/SIZE][/FONT]
case 4:
[FONT="Courier New"][SIZE="2"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");
ProgDefGroupType(COMMON);[/SIZE][/FONT]
None of them changes the result: The shortcut always being created under the folder
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\ \Desktop[/SIZE][/FONT]
Come to think of it, maybe it's the keyword DesktopFolder not doing its job. According to the documents, DesktopFolder should be dynamically pointed to either
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\All Users\Desktop[/SIZE][/FONT]
or
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\ \Desktop[/SIZE][/FONT]
depending on whether ALLUSERS is set to 0 or 1. But in my case, it never changes.
Any more ideas that I can try are appreciated. Thanks.
[FONT="Courier New"][SIZE="2"]if (BUTTON_CHECKED = CtrlGetState(szDialogName, CHKBX_DESKTOP)) then
AddFolderIcon (DesktopFolder, "MyApp", PATH_APPEXE, INSTALLDIR, PATH_ICO, 0, "", REPLACE);
endif;[/SIZE][/FONT]
Here are what I have done - right above of these three lines of script, I tried to put:
case 1:
[FONT="Courier New"][SIZE="2"]ALLUSERS = 1;[/SIZE][/FONT]
case 2:
[FONT="Courier New"][SIZE="2"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");[/SIZE][/FONT]
case 3:
[FONT="Courier New"][SIZE="2"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");
if (ALLUSERS != 1 ) then
ProgDefGroupType(COMMON);
else
ProgDefGroupType(PERSONAL);
endif;[/SIZE][/FONT]
case 4:
[FONT="Courier New"][SIZE="2"]MsiSetProperty(ISMSI_HANDLE, "ALLUSERS", "1");
ProgDefGroupType(COMMON);[/SIZE][/FONT]
None of them changes the result: The shortcut always being created under the folder
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\
Come to think of it, maybe it's the keyword DesktopFolder not doing its job. According to the documents, DesktopFolder should be dynamically pointed to either
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\All Users\Desktop[/SIZE][/FONT]
or
[FONT="Courier New"][SIZE="2"]C:\Documents and Settings\
depending on whether ALLUSERS is set to 0 or 1. But in my case, it never changes.
Any more ideas that I can try are appreciated. Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2007
11:10 AM
What is the type of project that you are using. I understood its InstallScript, and it seems you are mixing it with MSI properties.
If its pure InstallScript you should be using FOLDER_DESKTOP and ProgDefGroupType(COMMON);
This combination works for me.
Good Luck!
If its pure InstallScript you should be using FOLDER_DESKTOP and ProgDefGroupType(COMMON);
This combination works for me.
Good Luck!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2007
12:00 PM
Oooh, I am using InstallScript MSI...
Any solution for this particular type?
It could be that I have to change the ALLUSERS setting in some MSI property table or something, instead of in InstallScript then. I read some post earlier that I could change ALLUSERS in the Property Manager table, but I could find any entry related.
Any solution for this particular type?
It could be that I have to change the ALLUSERS setting in some MSI property table or something, instead of in InstallScript then. I read some post earlier that I could change ALLUSERS in the Property Manager table, but I could find any entry related.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2007
01:14 PM
tada...finally...
It turned out the problem really lies in the variable DesktopFolder. I thought FOLDER_DESKTOP was deprecated so I used DesktopFolder instead...which brought me all the troubles. Looks like InstallShield doesn't update the value of the DesktopFolder after its initiation.
Thank you guys for the inspiration and tips!
It turned out the problem really lies in the variable DesktopFolder. I thought FOLDER_DESKTOP was deprecated so I used DesktopFolder instead...which brought me all the troubles. Looks like InstallShield doesn't update the value of the DesktopFolder after its initiation.
Thank you guys for the inspiration and tips!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 05, 2011
10:15 AM
Sorry for bringing up this old thread...but I have the same problem with Installshield 2011. I set the ALLUSERS property in the customer information dialog but the DESKTOPFOLDER variable doesn't change. I have a Basic MSI project. If I change the ALLUSERS property right from the start, my files are copied to '\Desktop' or 'All Users\Desktop'. But not when ALLUSERS is changed via the UI dialog. Can anybody help me?