View Full Version : Newb with a Question...
Deevious
03-05-2006, 07:30 PM
I'm new to using Setup Factory (And let me tell you, it's very easy to use and does anything I need it to). What I want to do:
On a Post Uninstall, I want to check for a folder and a shortcut. If neither exist, I want to delete the folder.
if (not Folder.DoesExist("C:\\Documents and Settings\\All Users\\Start Menu\\My Apps\\AppsOne")) and (not File.DoesExist("C:\\Documents and Settings\\All Users\\Start Menu\\My Apps\\AppTwo.lnk")) then
Folder.DeleteFolder("C:\\Documents and Settings\\All Users\\Start Menu\\My Apps\\", nil);
end
Where'd I screw up? Lol.
Absynthe
03-05-2006, 11:41 PM
It will probably work better if you use the actual delete folder command which is Folder.Delete :)
Deevious
03-06-2006, 08:17 AM
Ooops! Well, in my script I have it correct, I just typed it wrong when I posted here. :p
Anyone know why it's not working?
Eagle
03-06-2006, 03:27 PM
Hi there, probably missing the 'programs' folder in your path as below.
"C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\My Apps\\AppsOne"
try this though and makes use of a builtin shell action aswell:
--set a lua variable for the shell.get folder action
SMenuPgmCmn = Shell.GetFolder(SHF_STARTMENUPROGRAMS_COMMON); --full path to all users startmenu\\programs folder
if (SMenuPgmCmn ~= "") then
if (not Folder.DoesExist(SMenuPgmCmn.."\\My Apps\\AppsOne")) and (not File.DoesExist(SMenuPgmCmn.."\\My Apps\\AppTwo.lnk")) then
Folder.Delete(SMenuPgmCmn.."\\My Apps");
end
end
the above code makes the main path generic for any windoz system
(if it still does not work then in theory both the conditions have not been met or there is a subfolder present)
could also explore the folder.deletetree action (use caution with this one)
hth
Deevious
03-06-2006, 04:51 PM
I can't believe I forgot \\Programs\\...
It works now.
Deevious
03-13-2006, 11:34 AM
Well, I have another problem/question (I'm sure it's another case of idiocy on my part).
I'm adding a registry key and want the data for "Path" to change depending on where the user decided to install the software. How would I code it? I have tried several times but the end result is never correct.
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\App.exe", "Path", "C:\\Program Files\\My App", REG_SZ);
Lewis Arts
02-09-2007, 06:03 PM
Search the help files for %AppFolder%
I think that will help.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.