In my OnFirstUIAfter function, I rename a file that was just installed, using:
RenameFile(FileName1, FileName2);
In my OnMaintUIAfter function, I install FileName1 again, but it needs to over-write FileName2, just as it did in the initial install. If I simply use:
RenameFile(FileName1, FileName2);
Nothing happens. I still have both files in the INSTALLDIR, and FileName2 is out of date.
Believing that there's a problem with the installer script not being able to rename an existing file, I have since determined to delete the file prior to the rename.
DeleteFile(FileName2);
RenameFile(FileName1, FileName2);
And still nothing happens. Both files are still in the INSTALLDIR.
Keep in mind that FileName2 is not a file being installed by any previous install. All the installs install FileName1 and then rename it to FileName2.
Any words of wisdom? I'm completely out of ideas.
SH
My best words of wisdom would be to stop writing custom actions. Learn the component rules and file versioning rules and let MSI do the heavy lifting for you. Out of process custom actions will only muddy the waters.
Related
I need to replace the existing binary during rpm upgrade but I do not want to change the permission/ownership which is set already.
In my case, after the binary installation (not upgrade), ownership/permissions are set properly by rpm. But after the rpm installation, permissions/ownership of the file are modified by admin to allow another process to run this binary. Owner/group of the another process is different from this process. But when the rpm is upgraded it resets the permissions/ownership and another process is now not able to execute it.
Looking for a solution on how to retain the existing ownership/permissions but replace the binary only.
Any type of help/pointers are appreciated. Let me know if you have any questions.
Read the state of the file in %pre and restore it in %posttrans for more informations see https://fedoraproject.org/wiki/Packaging:Scriptlets#Saving_state_between_scriptlets
I've spent literally the last 5 hours around this, and can't get it to work.
I've done everything it's said in similar questions.
Change the ProductCode, keep the old UpgradeCode, Change product version.
Again and again. It doesn't replace the updated .exe file it's supposed to.
What am I missing?
Edit: I also have doublechecked the .exe build in visual studio, there it's builded and working properly. Only when I run the setup that's supposed to copy it to install folder, and only then it fails, keeping the old .exe file there, and not updating.
Does the exe on the target system have the same or higher file version than the exe you are installing? Windows installer will not overwrite a file that has a higher file version then the file it is installing.
look at the install log. search for the component name, check the Request/Action state. Is the state set to "Local"? Also search for the file name to see if msiexec tried to copy it.
I installed tcl to learn it, however, I installed all the files in the wrong location. I am trying to uninstall it, But the uninstall file does not work. I am trying to carry out the instructions form their website:
To uninstall ActiveTcl, run the "uninstall.tcl" script that is located in the directory where you extracted the ActiveTcl archive. Note that you must use the "wish" in the distribution you wish to uninstall. For example:
% /path/Tcl/bin/wish /path/Tcl/lib/ppm/log/ActiveTcl/uninstall_ActiveTcl.tcl
stored, by default, in the directory /lib/ppm/log/ActiveTcl. You must use the wish interpreter from the distribution you wish to uninstall. Ensure that you do not run the uninstall script from a directory that will be removed during the uninstallation.
For example:
% /path/Tcl/bin/wish /path/Tcl/lib/ppm/log/ActiveTcl/uninstall_ActiveTcl.tcl
Note: if you are uninstalling both ActiveTcl and Tcl Dev Kit, uninstall Tcl Dev Kit before uninstalling ActiveTcl.
There is no uninstall_ActiveTcl.tcl. I do see an "uninstall" file but it does not have an extension, and I do not know how to run it.
Any help is appreciated
Thank you
Try editing the file to a uninstall.tcl file and see if that works. Take a back-up first though. Because we might need that file later
I re-installed it in a new location, compared the files that were installed between the old and the new location and deleted the file sin the old location. Unfortunately I could not delete many of the hidden files, as I did not know if they were there originally or if they belonged to Tcl. I am really surprised and disappointed there is no easy way to uninstall tcl properly.
I strongly suspect that you should uninstall ActiveTcl as follows:
Open a command prompt
Change directory to where you found the install file - e.g.
$ cd path_to_Tcl_installation/bin
Run the file
$ ./uninstall
On linux systems, you don't need any particular file extension in order to be able to run a file.
I don't know CentOS but a little googling led me to a forum thread that describes how to open a command prompt.
Good luck
I am trying to install critlib on my machine (http://equi4.com/critlib/), so that I can create zip files dynamically in Tcl.
The issue is that I have no idea how to install Tcl packages. Is there a certain place you put the folders? Is there a command like yum I can use?
I've skimmed the various Tcl beginners guides and read the sections about packages, but every source always seems to be assuming knowledge I lack.
Yes, there are some directories. To list them, execute tclsh and enter
join $auto_path \n
In each of that directory and its subdir (but not the sub-sub-dir) tcl looks for a file called pkgIndex.tcl.
So if you got an archive, extract it, look where the pkgIndex.tcl is, and copy the directory where this file is in to one of the paths $auto_path. The problem is only to select the appropiate path from the output of step 1.
If you are not sure what the appropiate directory is, I suggest editing the output from the first step into your question.
If you are using vscode and made virtual environment then you can do it as follows
"pipenv install tcl"
I'm creating a windows installer with CPack and NSIS. During the install process the user should be asked if he wants to associate my program with a file extension. At least if you do "open with..." on a file with the extension windows should be told that you can open it with my program. Does anybody know how to do this?
Go to your nsis installation folder on you system and have a look at makensis.nsi from the examples directory. It associates .nsi to makensisw.exe.
Good luck ;)
To create file associations using NSIS I would recommend using NSIS plugins mentioned by Andrei T: File Association and FileAssoc. To integrate them into CPack you need to include the script, call macro during install step, call other macro during uninstall step.
For example this is how I use "File Association" plugin:
# Including
set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS
"!include \\\"${path_to_plugins}\\\\fileassoc.nsh\\\"")
# Create association
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"\\\${RegisterExtension} '$INSTDIR\\\\myprogram.exe' '.myext' 'my_program_key'")
# my_program_key can be any string that gives some hint what this file type is about. And should not contain strings
# Remove association
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
"\\\${UnRegisterExtension} '.myext' 'my_program_key'")
In this implementation it is not an optional step.
Please note the double escape. It is required because CPack creates intermediate file with those strings and if you escape only once there will be a syntax error.
Also note that all CMake paths should use back slashes. I convert them with:
get_filename_component(path_to_plugins"${path_to_plugins}" ABSOLUTE)
file(TO_NATIVE_PATH "${path_to_plugins}" path_to_plugins)
string(REPLACE "\\" "\\\\" path_to_plugins"${path_to_plugins}")