Browse Source

Merge pull request #253 in BA/design from ~ZHOUPING/design:dev to dev

* commit '518254d0065249829b0dace101933751b8515978':
  bug88297:使用升级更新插件的时候,有的jar包概率性删除失败
master
superman 8 years ago
parent
commit
7c0d5ea12e
  1. 26
      designer_base/src/com/fr/design/RestartHelper.java

26
designer_base/src/com/fr/design/RestartHelper.java

@ -4,15 +4,11 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.*;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils; import java.io.*;
import com.fr.stable.StringUtils; import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -153,6 +149,18 @@ public class RestartHelper {
} }
try { try {
try {
File restartLockFile = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), "restart.lock"));
StableUtils.makesureFileExist(restartLockFile);
RandomAccessFile randomAccessFile = new RandomAccessFile(restartLockFile,"rw");
FileChannel restartLockFC = randomAccessFile.getChannel();
FileLock restartLock = restartLockFC.tryLock();
if(restartLock == null) {
FRLogger.getLogger().error("restart lock null!");
}
}catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
if (OperatingSystem.isMacOS()) { if (OperatingSystem.isMacOS()) {
restartInMacOS(installHome, filesToBeDelete); restartInMacOS(installHome, filesToBeDelete);
} else { } else {

Loading…
Cancel
Save