|
|||
|
In the "BeforeUninst" script, you just need to remove the shortcut as follows:
I am using the following code at the uninstall script trying to removing the shortcut I have installed in the startup menu, but somehow, the shortcut icon in the startup menu still hasn't been removed. If anybody knows how to solve this problem in the SWFkit, please reply this thread. Thank you very much. Code: // get the startup folder var startup = Shell.getSpecialFolder("startup all"); // remove the shortcut var f = new File(startup + "\\My Demo" + ".lnk"); f.remove(); |
|
|||
|
Hi, Thanks for the reply.
I have tried the file you attached, but it works out the same with mine. I have tried in 2 different computers. When I uninstall the program, the icon in the "startup" folder is still there. Do you see the shortcut in the "startup" menu disappear when you tested in your computer? I am not sure if there is anything to do with different language Windows. We are testing this program in Chinese Windows, would that be the problem? Is that because the startup folder is different?? But it works fine while installing, the problem only happens when "uninstall". The startup directory I found in my computer is ![]() Is there anything need to be modified regarding using the different language windows? |
|
|||
|
..this is old bug..
..some functions not working in AfterInstall and BeforeUninst scripts.. ..solution: ..call your script from BeforeUninst as another script.. //BeforeUninst Script invoke("Uninstall"); ------- //Uninstall Script ......your script for remove shortcut..... |
|
|||
|
Hi IksY,
Thanks for replying the thread.. I have tried your new suggestion... But it still doesn't remove the shortcut from the startup... Have you ever tried the uninstallation successfully using swkfit before? And did you see the uninstallation working in the startup group? If you do, please point out any special code for that? I also wish the SWFKIT has any solution for this situation.. or anyone has ever done the uninstallation successfully... |
|
|||
|
..hi laxi..
..do several tests and post results to this thread.. 1) ..is the shortcut removable via explorer ?? 2) ..log yourself to system as administrator..install / uninstall your app.. ..was shortcut removed ?? 3) ..create simple test app (no installer) for remove the shortcut..run it.. ..was shortcut removed ?? 4) ..in your app - BeforeUninst script: ..write shortcut path as full-path-string.."c:\\doc...........my demo.lnk".. ..compile, install, uninstall.. ..was shortcut removed ?? 5) ..are working other functions (copy, move) and is possible rename the shortcut via BeforeUninst script ?? ..test it.. 6) ..open explorer..create in startup folder shortcut "test.lnk" and text file "test.txt".. ..modify your BeforeUninst script for remove "test.lnk" and "test.txt".. ..compile, install, uninstall.. ..was removed "test.lnk" ?? ..was removed "test.txt" ?? 7) ..modify your BeforeUninst script: Application.traceToFile("<your temp dir>\\test.txt"); var dir = Shell.getSpecialFolder("startup all"); var lnk = dir + "\\My Demo.lnk"; trace("startup dir: " + dir); trace("shortcut: " + lnk); trace("shortcut exists: " + File.exists(lnk)); var file = new File(lnk); if (file == undefined) { trace("File open: Failed"); } else { trace("File open: OK"); if (file.remove()) { trace("File remove: OK"); } else { trace("File remove: Failed"); } } ..after install / uninstall open "test.txt" in temp folder.. ..copy and paste content to this thread.. |
|
|||
|
Hi IksY,
Thanks for pointing out couple ways to test out the problem. Base on your suggestion.. I have tried out couple things and found something interesting.. 1. I put a file in a testing folder and use the uninstall to remove the file. It works well with the original code when I specify the file location. 2. I put a file in the "startup" folder, and try to use the same way to remove the file. It didn't work. Firstly, let me discribe a little bit about my computer setting... In my windows, there are 2 Windows OS installed in my computer. The original OS came with the computer was an Japanese version Windows XP Home. So, it has used the default windows folder name "WINDOWS" referring the default OS. And then I installed a second OS in this computer which is a Chinese Windows XP professional. Which uses the folder name "WINDOWSC" And I made these 2 OS listed in the boot menu. I have tested this APP in the Japanese Windows, which has been referred as "WINDOWS", and the uninstallation works well to remove the lnk file in the startup folder in that Japanese Windows..... But when I was using the Chinese windows, which has been referred as "WINDOWSC" folder. The uninstallation startup lnk removal becomes a problem... No matter the full path or using var f = new File(startup + "\\InsDemo" + ".lnk"); I can never make the lnk file removed successfully. I have already tried to put a txt file in the same directory, still seems nothing can be touched under that folder. So base on these testing result... I think the problem might be as follow.. 1. I have tested couple different combination of different kind of direct folder directory, and I found in other language (Chinese language) combines some special character as the file names... The removal is not stable all the time. I think maybe there is some bug while the SWFKIT parsing the string.. cuz while compiling.. sometimes, the warning message shows up as warning: line 12: unknown escape sequence \? And when that warning happens.. the access of removing that file in that particular folder would fail... 2. While using (startup + "\\InsDemo" + ".lnk"); Maybe because the Chinese language OS startup menu wasn't using the "WINDOWS" default file name.. but using "WINDOWSC" as a second OS. so the directory it gets caused some problem while processing the data of the directory... Maybe that's problem or maybe not.. but the testing results While I put a file in C:\Documents and Settings\All Users.WINDOWSC and point to the full path It would be removed successfully ------------------------------ And when I put a file in ![]() and point to the full path The file removal function started to fail... There must be something to do with language or second OS affecting the SWFKIT compiling.. |
|
|||
|
I tested the same original code and tested the install and uninstall process in English Windows, Japanese windows and chinese windows in 6 different computer...
I found the startup removal works in Japanese windows and Egnlish ones... And in Traditional Chinese Windows, the result is not stable, seems there is some bug while compiling the string of Chinese startup path in SWKFIT. Hopefully, when SWFKIT team find this thread, they would be able to fix something at the SWFKIT software...regarding the text parsing problem in different language code set. Thanks for the help~~! |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|