Start in shortcut
hi!
is ther any ideas, how can i change in msi start in for the shortcut?
is ther any ideas, how can i change in msi start in for the shortcut?
0 Comments
[ + ] Show comments
Answers (15)
Please log in to answer
Posted by:
pjgeutjens
13 years ago
have you tried running the command
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?
As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.
EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.
PJ
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?
As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.
EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.
PJ
Posted by:
MSIPackager
15 years ago
Posted by:
lanselots
15 years ago
Posted by:
anonymous_9363
15 years ago
Posted by:
lanselots
15 years ago
Posted by:
anonymous_9363
15 years ago
Posted by:
lanselots
15 years ago
Posted by:
JillBA
15 years ago
Posted by:
Curry
13 years ago
Good day everyone.
I feel a bit odd reviving such an old thread, but still I did a search :). First time ever I was unable to find a solution.
I have the same problem and it hasn't been resolved yet.
Quick recap:
I need to set Working Directory in a Shortcut during install to point to %APPDATA%\Logs for any given user.
Problem is (and i found it the hard way through trial and error) "The references are resolved to an actual path when the installer resolves the working directory to create the shortcut."
So when the installation is done under any user accout, "Start In" field is populated with that user's appdata folder for every other user.
I'm using ORCA and I guess this could be somehow achieved with populating CustomAction table, but i've been into Windows Installer Database editing for like couple of hours or so, and my knowledge is less than basic. Any direction (and i mean step-by-step guide :D) would be kindly appreciated.
Thanks in advance!
I feel a bit odd reviving such an old thread, but still I did a search :). First time ever I was unable to find a solution.
I have the same problem and it hasn't been resolved yet.
Quick recap:
I need to set Working Directory in a Shortcut during install to point to %APPDATA%\Logs for any given user.
Problem is (and i found it the hard way through trial and error) "The references are resolved to an actual path when the installer resolves the working directory to create the shortcut."
So when the installation is done under any user accout, "Start In" field is populated with that user's appdata folder for every other user.
I'm using ORCA and I guess this could be somehow achieved with populating CustomAction table, but i've been into Windows Installer Database editing for like couple of hours or so, and my knowledge is less than basic. Any direction (and i mean step-by-step guide :D) would be kindly appreciated.
Thanks in advance!
Posted by:
naveen.packager
13 years ago
Have you checked in usermode after self healing of application?
In user mode after the first self heal the start in folder path is getting changed to that USERPROFILE.
But when you get back to administrator again, it will show the path of that user where it has been last selfhealed.
If you are using this application for different users of the same pc then this is a problem because it will show the path of the user in which it has been last self healed.
I am not sure if you can get this done by using custom action, but ypu can use active setup to create the shortcut.
In user mode after the first self heal the start in folder path is getting changed to that USERPROFILE.
But when you get back to administrator again, it will show the path of that user where it has been last selfhealed.
If you are using this application for different users of the same pc then this is a problem because it will show the path of the user in which it has been last self healed.
I am not sure if you can get this done by using custom action, but ypu can use active setup to create the shortcut.
Posted by:
an33th
13 years ago
ORIGINAL: pjgeutjens
have you tried running the command
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?
As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.
EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.
PJ
This works!!! The shortcuts gets repaired to point to the desired working dir.
Posted by:
naveen.packager
13 years ago
PJ,
Your command works.
But i observed one problem here in admin mode(or if any user have administrator rights). In admin mode even after running that command(or even after manually reparing from msi) the path wont change, it will be the path of the user last accessed and it will use that file.
If you delete the admin appdata file, it wont self heal.This may be because it is having permission to access the key file from user.
Just out of curiosity iam posting this. May be this will be a problem in these type of scenarios.
Your command works.
But i observed one problem here in admin mode(or if any user have administrator rights). In admin mode even after running that command(or even after manually reparing from msi) the path wont change, it will be the path of the user last accessed and it will use that file.
If you delete the admin appdata file, it wont self heal.This may be because it is having permission to access the key file from user.
Just out of curiosity iam posting this. May be this will be a problem in these type of scenarios.
Posted by:
Curry
13 years ago
Yeah... Thank kinda works, but still doesn't seem right...
Here's what i did:
1. Create new vbs script Shortcut.vbs.
2. Open up you MSI project in ORCA and go to Binary table. Add Row:
3. Go to CustomAction table. Add Row:
(Type 6 stands for VBScript)
4. Go to InstallExecuteSequence table. Add Row:
5. Go to Shortcut table and remove unneeded rows.
Still one problem remains.Working Directory folder and shortcut are not removed on uninstall . This doesn't bother me at all but might be an issue for someone.
Here's what i did:
1. Create new vbs script Shortcut.vbs.
'Replace the following:
'<Your directory> - specify your directory with any number of parent directories
'Thanks to: http://www.appdeploy.com/messageboards/fb.asp?m=28595
'<Shortcut name> - obvious
'<Path to .exe> - path to .exe file you are making a shortcut to.
'Example: %PROGRAMFILES%\Internet Explorer\iexplore.exe
'<Path to icon> - example: %PROGRAMFILES%\Internet Explorer\iexplore.exe, 0
'Creating a folder first.
Dim WSHShell : Set WSHShell = CreateObject("WScript.Shell")
Dim sAPPDATA : sAPPDATA = WSHShell.Environment("Volatile").Item ("APPDATA")
Dim Path : Path = sAPPDATA & "\<Your directory>"
Call Recursion(Path)
Function Recursion(DirectoryPath)
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(DirectoryPath) Then Exit Function
Call Recursion(FSO.GetParentFolderName(DirectoryPath))
FSO.CreateFolder(DirectoryPath)
End Function
'Now for the Shortcut itself
set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\<Shortcut name>.lnk")
oShellLink.TargetPath = "<Path to .exe>"
oShellLink.IconLocation = "<Path to icon>"
oShellLink.WorkingDirectory = "%APPDATA%\<Your directory>"
oShellLink.Save
2. Open up you MSI project in ORCA and go to Binary table. Add Row:
Name: AddShortcut
Data: <Full path to vbs script>\Shortcut.vbs
3. Go to CustomAction table. Add Row:
Action: RunAddShortcut
Type: 6
Source: AddShortcut
Target: <leave blank>
(Type 6 stands for VBScript)
4. Go to InstallExecuteSequence table. Add Row:
Action: RunAddShortcut
Condition: NOT Installed
Sequence: 6500
5. Go to Shortcut table and remove unneeded rows.
Still one problem remains.
Posted by:
naveen.packager
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.