+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Renaming a previous install prior to new install

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Renaming a previous install prior to new install

    Hi There,

    I have a new install that I am making and I am having trouble in one area of it. At the beginning of the install I need to rename a folder to a new name. Then I will create and install a new folder that utilizes the same name as the folder I recently renamed.

    To do this, I have been trying to use the rename command in my script. But when I run the install to fails to do so. It's like it pretty much did nothing. I have tried moving the command to different areas in the script but have not had much success.

    Anybody have any useful ideas of how I could better handle this? Thanks,

    Brandon

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Renaming a previous install prior to new install

    Brandon,

    The rename function (a wrapper around the MoveFile Windows API) only fails if:

    1. The current name of the directory on the local computer and/or the new name for the directory is incorrect.

    -or-

    2. The current name of the directory is locked (shared, permission issue, etc.).

    -or-

    3. The new name does already exist.

    Do you rename the folder after the "Ready to Install" dialog? That means, are the old/new folder name variable values set? If you are interested, send your project to support [at] lindersoft [dot] com and we can review the script logic for you.

    Friedrich

  3. #3
    Unregistered Guest

    Default Re: Renaming a previous install prior to new install

    Quote Originally Posted by linder View Post
    Brandon,

    The rename function (a wrapper around the MoveFile Windows API) only fails if:

    1. The current name of the directory on the local computer and/or the new name for the directory is incorrect.

    -or-

    2. The current name of the directory is locked (shared, permission issue, etc.).

    -or-

    3. The new name does already exist.

    Do you rename the folder after the "Ready to Install" dialog? That means, are the old/new folder name variable values set? If you are interested, send your project to support [at] lindersoft [dot] com and we can review the script logic for you.

    Friedrich
    Email sent!

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Renaming a previous install prior to new install

    There was no attachment to your email; can you please resend it with the attachment?

    Friedrich

  5. #5
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Renaming a previous install prior to new install

    Brandon,

    See attached screenshots. Tested on Windows 7 Ultimate x64. The code renamed c:\fpa to c:\FPA Archive.

    In Windows, rename is handled via the MoveFileA API (the "Rename File/Folder" function is a wrapper around this API).

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    Friedrich
    Attached Images Attached Images     

  6. #6

    Default Re: Renaming a previous install prior to new install

    Yes, I changed the position and tried this right before I sent it to you. I see it is working here as well. Do the copy command further down in my code look efficient as well? Right now my installer if finishing without copying any files. Can you see any reason why that would be?

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Renaming a previous install prior to new install

    I would recommend not to perform any action BEFORE the "Ready to Install" dialog. You rename folders and create the uninstall app before that dialog. This should be done AFTER the "Ready to Install" dialog (to give the user a "choice"; install or not install).

    And I don't think that your "Get INI Value" script function to set the %DATAPATH% variable value succeeds. You set "INI Item" to "Datapath=" but it should be "Datapath" only.

    In other words, the installer can't copy files because the source location is incorrect or not set at all

    BTW, you should move your last "Run Program" action AFTER the last "Loop Wizard/End" statement. Otherwise, the installer launches the aas2.exe before the Finish dialog is displayed.

    And please note that you have developed a per-user ("asInvoker") install. So all your "per-machine" actions will fail (e.g. the OCX registrations for exportmodeller.dll and crtslv.dll).

    Does this help?

    Friedrich

  8. #8
    Unregistered Guest

    Default Re: Renaming a previous install prior to new install

    Friedrich,

    That helped a lot. I am going to clean up all my installs with your information.

    The installer is working pretty well now but I am having an issue with it on some workstations. I made the installer run requiring administrator versus asinvoker now. It seems that if a workstation with Windows 7 or Windows 8 has UAC turned on or something, my installer will not copy its files correctly. It runs the programs I ask it too and copies some files but it skipping my script where it copies all dlls, exes, and etc.

    Any ideas on why that would happen? On workstation that have UAC turned off, everything seems to install correctly. By the way, I greatly appreciate all the help you have given me. Lindersoft support is top notch!

  9. #9
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Renaming a previous install prior to new install

    Thank you for your kind words

    I think the copy process does not work correctly on some machines (with UAC enabled) because your source location is still incorrect on these machines. I would suggest to add some code to the script to detect such an incorrect source location scenario. It's not caused by the elevated running installer. "Something" in your application design is not UAC-aware/compliant.

    I noticed that you read from a protected folder (e.g. %WINDIR%\aas2.ini to set the %CALLINGPATH% value). Only elevated running and UAC-aware!!! applications can write to this INI file. So I think that one of your apps that previously wrote the path to this INI file is not UAC-aware and as a result, virtualization kicks in and redirects the write action to another folder. So the "real" %WINDIR%\aas2.ini does not have the value you are looking for, only the virtualized one.

    You should never store your data in the Windows folder. You have to make your applications UAC-aware to follow the Windows development guidelines.

    Does this help?

    Friedrich

  10. #10

    Default Re: Renaming a previous install prior to new install

    I see. Well I changed my script to not poll or use anything in the windows folder anymore. I also used message boxs in my script to confirm my datapath and callingpath are being collected right. So far both of those message boxes are confirming that it has the correct value. Neither of these issues have fixed my issue though.

    Could this be because my installer and applications do not have a UAC manifest?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •