Junction point of mklink to environment variable path - windows-server-2003

I was wondering if it were posible to use use junction (or mklink?) to have c:\Projects point to the current users my documents\projects map.
I tried junction.exe c:\project "%HOMEPATH%\my documents\projects" but it just makes a link to the interpretation of the path and not to the variable (so c:\projects would point to administrator\my documents\projects instead of %HOMEPATH%).
I'm using Windows Server 2003 R2.
Thank you!

It isn't possible to do exactly what you are describing. i.e. Have a Junction that dynamically routes itself based on an environment variable.
You can get close to this behavior by creating a logon script that deletes and recreates the junction when the user logs in. Obviously this only works if there is only ever one user logged into the box at a time, otherwise they would be stomping over each other.

Related

RPA Blueprism release file Successfully imported but not visible in processes list

I've successfully imported a *.bprelease file to my Blue Prism environment, but the contents are not visible in processes list.
What can I/should I do to have the contents of the package appear in the list after importing?
This problem lies in a bug in new version of Blue Prism. It is actually quite common, I've seen this happen for a few people in my team. There are two things needed to know to fully understand the problem:
Since 6.3 (the multi-team env. upgrade) when you import an object/process that is not in a group, it will be added to a new group called 'Default'
Blue Prism will not allow you to manually add a group with the name of an existing group (under the same parent group)
If a group with a duplicate name gets created anyway (by an import or by DB command), one of the groups will not be displayed
And that is what happened here.
The easiest thing to resolve this problem is to simply rename the 'Default' folder you see to something else and then refresh the view (hit F5). You should see a new folder pop-up, with your invisible objects.
Alternatively, you could achieve the same results with a couple of SQL scripts, but this is much quicker.
Sometimes even renaming the default folder does not work.
It is because there is a previous object (for example) with the same name, but not assigned to any folder.
We have solved the issue importing the object alone, and chosing "renaming the previous version" option instead of overwriting. So, the object is properly imported and placed in the Default folder, from where you can move it to the right one

How can I use a dialog to define the program group name in Installshield 2015

I am currently trying to expand our installation program with an option for the user to specify the name of the program group where shortcuts are created under the start menu. (I am aware that this is a somewhat outdated concept)
I am using InstallShield 2015.
I created a localizable property named [PROGRAMGROUP_NAME]. This has automatically created an {ID_STRING46} which I've set to the desired default value. So far so good.
I managed to create a custom dialog with an edit control, which is linked to the above property.
Now comes the tricky part: Under Shortcuts, under "Programs Menu" I first want to add a folder with the program group name, under which to place several shortcuts.
If I enter [PROGRAMGROUP_NAME] that is literally what the name becomes. If I use {ID_STRING46}, it uses the default value, and not what I've entered in the dialog.
Incidentally, when I tried to rename ID_STRING46 to something more meaningful, other things started going wrong so I've left that as is.
What is going wrong here? How do I get the value of the property to be used for the folder name?
EDIT
I am trying to use a custom action now, but I have trouble defining it. My Dialog that sets the property is after CostFinalize, so I assume I have to use SetDirectory - but I have trouble defining it. I get an error stating "could not access network location "
EDIT
I've managed to progress a step. I have manually added a directory with key DIRECTORY_PROGRAM_GROUP (important that it's all caps to make it public) to the directory table. Then, I use a custom action to set that directory to the desired value [ProgramMenuFolder][PROGRAM_GROUP_NAME] after I've run my dialog, and I've modified the shortcut to be created in that folder.
Seems to work great, however, now the program group is no longer removed when uninstalling...
Shortcuts are installed to folders, and the name of the folders below ProgramMenuFolder become the program group as you describe it. So you will need to either build up the Directory table (either directly---note that the DefaultDir column is localizable, and there may already be a string you can update---or through the Files and Folders view) to do what you want, or use custom actions (set property, if before costing; set directory, if after costing) to adjust the location to which your shortcut is installed.
As for the problems renaming ID_STRING46, odds are you didn't update a reference after you changed the name of the string. The simplest way to track down where these are may be to examine differences in the built installer (perhaps using InstallShield's MSI Diff) and then update the relevant references using the direct editor if you can't find them in the normal views.

Inno Setup define the {tmp} location

I need to define the {tmp} constant (i.e. the automatically generated TEMP location), so that it always remains the same and does not change each time it is run. Ideally setting it to the root of the users TEMP directory, rather than the automatically created subdirectory (e.g. is-70G7E.tmp):
C:\Users\Username\AppData\Local\Temp
Instead of:
C:\Users\Username\AppData\Local\Temp\is-XXXXX.tmp
Is this possible and, if so, how could it be done?
To expand on the reason for this, in response to comments below, when using InnoTools Tray, it creates multiple entries in the System Tray Notification Area Icons:
This is because each time it is run, it is run from a different {tmp} folder. If I can set this manually myself to be constant and handle the issues of checking for files in use etc it will resolve this issue.
If there is another way to resolve this, then I am open to suggestions.
It's not possible. The creation of random subdirectory in TEMP is hardcoded. There's no way to change it.
See the CreateTempDir function in Inno Setup source code.
You didn't state why you need it to be constant, but a problem may rise if you use a constant folder. What if the folder or files in it are in use? That's why {tmp} varies, and Inno Setup handles it for you.
However, you can use the {%TEMP} constant or the GetTempDir function instead, with whichever sub-folder you like as a constant. You may need to handle its creation and deletion though.

SharePoint 2007 - Copy files and assign attributes?

I've got this one thing I'm not really sure where to begin with. In our SharePoint 2007 solution, we've got this project room where each employee has their own folders with their resumé etc. And we want this information to be distributed to their MySite.
I've noticed that I can basically copy the files from one are to the other. But the files in MySite are connected to the corresponding user based on properties of some sort. But they are not regular file properties is seems. When I open all of the files in the MySite files collection, I can see categories such as Title and Name. If I copy a file in there, these properties are blank. And if I manually assign a username to the Name property, the file automatically appears in the correct user's MySite.
Probably horribly explained.. But, is it possible to program this somehow? I would like a nightly or weekly schedule that basically copies the content and assigns the username and title to the correct fields. I can pick up both the title and the username based on the folder names. This I can probably solve later. It's just where to begin that's bothering me. Do I use SharePoint designer? Can I user VB code? Do I have to code at all? I've never developed a thing for SharePoint before. And no, I do not want to be redirected to a basic "Getting started with developing for Sharepoint" site.. Just a simple answer really, on where to begin.
Simple answer: Yes you can use VB. Create Timerjobs.
TimerJobs you can set to start on specific weekdays, specific hours etc. and they do exactly whatever you program them to do.

Changing vista file permissions programmatically

I want to add some files to C:\windows\XXX (windows protected folder, in Vista), under the "TrustedInstaller" for my application. I do not want to replace any file so no issues on Windows Resource(formerly file) protection.
I have the code to change "ownership" to the current logged in admin, however, I'm don't have any clue how to set its file permissions programmatically. I'm using VC++/MFC for development.
Thanks
I not 100% sure what you actually want (as do you want it to look like TrustedInstaller installed the files?) but look at this example of using SetNamedSecurityInfo. You generally need to constuct a Discretionary Access Control List (DACL) for your file, however you can "borrow" one off another file with the permissions you want to clone using GetNamedSecurityInfo as building a DACL from scratch is considerably more annoying.
An easy way to do it is to just use the system function to run icacls with whichever parameters you need. Note that it's found in cstdlib (#include <cstdlib>)
system("icacls <params>");

Resources